Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 07:43:26 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The happy programmer room
Pages: 1 ... 230 231 [232] 233 234 ... 279
Print
Author Topic: The happy programmer room  (Read 677687 times)
ferreiradaselva
Level 3
***



View Profile
« Reply #4620 on: March 24, 2017, 01:18:43 PM »

It is a metric, but not really a meaningful one.

https://www.mvps.org/directx/articles/fps_versus_frame_time.htm

In short:
Going from 900 to 450 FPS is around the same as going from 60 to 56 FPS, so the frames-per-second unit makes little sense when measuring code performance.

Yup. I've read somewhere that FPS wasn't so reliable, but I never found out why, thanks for the link!

Edit:

I made a benchmark with seconds as measure.

The smaller value in the vertical axix the better.

With pool: http://i.imgur.com/W3vHy35.png
No pool: http://i.imgur.com/tURb2yw.png
Vertical axis: time in seconds. The top value in the axis is 0.008, half of 16 milliseconds (0.016).
Horizontal axis: frames, 1 second apart of each other.
Lines: each line represent a test with different amount of objects.

Processor: Intel® Core™ i3-4005U CPU @ 1.70GHz × 4
Graphic card: Intel® Haswell Mobile (HD Graphics 4400)

Of course, these values are very small, even not using pool, but no callback for the objects (update or render) is called. I don't believe the callbacks will affect the performance using pool, because. But, I know the callbacks strongly affect when using lists, though, from past experience, because I need to traverse lists and compare strings (or their hash) holding name of objects or holding type name.
« Last Edit: March 24, 2017, 05:28:20 PM by felipefsdev » Logged

JWki
Level 4
****


View Profile
« Reply #4621 on: March 25, 2017, 10:32:59 AM »

So finally I've been able to do some programming for myself again, messing around with embedding processes in other processes:

The 'outer' process launches the 'inner' process and then finds the main window of that process, makes it a child window of its own window and then each frame that window is moved and fit inside the GUI widget.

Nothing else works but it's a first step. Moving the widget around is a bit laggy though and I guess that's because MoveWindow isn't really fast.

EDIT: Actually input seems to work. Sorta, the hosting application just crashes after some time, but until then input seems to be dispatched just fine which is niceish.

« Last Edit: March 25, 2017, 11:02:45 AM by JWki » Logged
oahda
Level 10
*****



View Profile
« Reply #4622 on: March 25, 2017, 12:32:34 PM »

You're kind of making me want to try this out, even tho I don't think I'll be needing it for the reasons I outlined, just to see how it all works... It's very interesting.
Logged

ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #4623 on: March 25, 2017, 12:37:35 PM »

I posted a thing yesterday about Go but it got paged almost immediately. Reposting for visibility.

I'm happy.

So, a little while back I decided to learn web design in order to make a website. My plan was to have a place to host web games with some ads in order to get some money to finance a Nintendo Switch. I've made good progress on the front page design of the site, and I have a good and realistic idea of everything I want to do with it. But the only thing I was missing was how to do a good server. The only options I could see where PHP, which, I mean, gross, and Python or back end JavaScript, which, as much as I love Python, sounds like it would be slower than molasses in Siberia.

But then my programming professor recommended Go to me.

I've only messed around with it for about three days, but I'm already in love with how easy it is to set up a server with it. Plus, it's a compiled language with a lot of syntactic sugar, which makes it look like a mix of Python and C/C++. I'm not too sure if I'm in love with array slices yet, but I'm willing to give them a change, because the rest of the language is simply beautiful.

I'm wondering how easy it would be to program a game with it, if that would even be a good idea in the first place. It really seems to be geared towards web stuff with it's native support of threads, but then again, that's also pretty useful for games. Maybe I'll try to do a thing someday, when I'm done with the website.

Note: The site is not available yet, I'm probably only gonna publish it once I have a game to go along with it.

Also, update: The server I started programming is technically functional now, just not hosted anywhere.
Logged

JWki
Level 4
****


View Profile
« Reply #4624 on: March 26, 2017, 12:18:00 AM »

You're kind of making me want to try this out, even tho I don't think I'll be needing it for the reasons I outlined, just to see how it all works... It's very interesting.

Yeah it's fun to play around with but also a lot of painful, very platform specific trial and error. Probably going to stay windows only just because I can't be bothered porting so much OS code.
Logged
ferreiradaselva
Level 3
***



View Profile
« Reply #4625 on: March 26, 2017, 03:06:35 AM »

:D
I decided to replace every linked list in the core of my engine with memory pools. And assets are managed by the core using memory pool, too.
Logged

JWki
Level 4
****


View Profile
« Reply #4626 on: March 26, 2017, 06:38:39 AM »

:D
I decided to replace every linked list in the core of my engine with memory pools. And assets are managed by the core using memory pool, too.

For assets I'd like to introduce you to the best friend of the memory pool, the memory stack.
Logged
JWki
Level 4
****


View Profile
« Reply #4627 on: March 27, 2017, 03:52:57 AM »

C++ reflection, baby:



becomes



The GUI structure makes no sense because LightSourceType is an enum and Light seems to be an Actor or whatevs but the enum values are dynamically retreived at runtime.
I've just done the most hacky implementation of this but now I have a feel for how it can work and can start doing a real reflection API.
libclang is a wonderful tool.
Logged
oahda
Level 10
*****



View Profile
« Reply #4628 on: March 27, 2017, 11:34:32 AM »

showwwwwww
Logged

JWki
Level 4
****


View Profile
« Reply #4629 on: March 27, 2017, 10:44:25 PM »

showwwwwww

Is that a request? :p if yes, specify?
Logged
oahda
Level 10
*****



View Profile
« Reply #4630 on: March 28, 2017, 02:53:04 AM »

yes!
Logged

JWki
Level 4
****


View Profile
« Reply #4631 on: March 28, 2017, 03:31:22 AM »

Okay so I'm using libclang which is a C-API that gives you access to an AST using the same functions that Clang uses.
This http://shaharmike.com/cpp/libclang/ is the like 101 thing I used as a basis, with these as additional reference:

http://austinbrunkhorst.com/blog/category/reflection/
http://www.myopictopics.com/?p=368

Essentially, you can iterate over the AST, visiting each node, and recurse as you like.
The simplest way of just visiting each node and printing out some information about it is in the first link I posted.
What I do, on a high level, and I'm just in the middle of implementing that, is doing one pass that visits each node, recursing whenever required, to collect all types - classes, structs, enums. I store the corresponding nodes and in a second pass, I visit the corresponding subtrees starting at each node, collecting attributes, fields, enum constants etc.

That data I store in a table format, where I have one table for each type, then a table containing all the fields (which the types index into to specify their fields) and enum constants.
I don't have a real use case for methods yet so I don't care about those rn but you can get the names and such easily. What you don't get that easily are the call addresses for them so that would be somewhat more complicated.
Logged
ferreiradaselva
Level 3
***



View Profile
« Reply #4632 on: March 29, 2017, 08:13:00 AM »

:D
I decided to replace every linked list in the core of my engine with memory pools. And assets are managed by the core using memory pool, too.

For assets I'd like to introduce you to the best friend of the memory pool, the memory stack.

I'm still not sure if I could use the memory stack for storing game objects (as their life time end at the end of the scope), but I will definitelly find use for something else.
Logged

BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #4633 on: March 29, 2017, 10:42:52 AM »

JWki: niiice
Logged
JWki
Level 4
****


View Profile
« Reply #4634 on: March 29, 2017, 11:04:19 AM »

:D
I decided to replace every linked list in the core of my engine with memory pools. And assets are managed by the core using memory pool, too.

For assets I'd like to introduce you to the best friend of the memory pool, the memory stack.

I'm still not sure if I could use the memory stack for storing game objects (as their life time end at the end of the scope), but I will definitelly find use for something else.

You don't have to use the actual stack you can allocate in a stack like fashion from a heap allocated buffer.
Logged
qMopey
Level 6
*


View Profile WWW
« Reply #4635 on: March 30, 2017, 09:54:22 AM »

Whatcha ganna do with dat reflection  Blink . Blink
Logged
JWki
Level 4
****


View Profile
« Reply #4636 on: March 30, 2017, 10:27:49 AM »

Whatcha ganna do with dat reflection  Blink . Blink

I've always wanted to have reflection in C++. My current use case which motivated me to try this out is automatic generation of tool UI.
Logged
qMopey
Level 6
*


View Profile WWW
« Reply #4637 on: March 30, 2017, 11:28:39 AM »

So the primary interest is auto-generated UI for tweaking values? Like tweaking ints/floats/strings? So pretty much serialization? COOL, SHOW MORE  Hand Any Key Well, hello there!
Logged
JWki
Level 4
****


View Profile
« Reply #4638 on: March 30, 2017, 12:14:12 PM »

So the primary interest is auto-generated UI for tweaking values? Like tweaking ints/floats/strings? So pretty much serialization? COOL, SHOW MORE  Hand Any Key Well, hello there!

Serialization and more specifically, being able to have the UI inside an application that doesn't even know about the actual types. As in, having an editor that doesn't share any code with the actual runtime.
Also this now works:



In theory if you use actual inheritance for game objects and stuff, that's already how you could populate a UI that offers you all things that you can place in the editor or whatever. When I add support for arbitary metadata (think C# attributes) you could do the same with a simple "PlaceInEditor" attribute or whatever without having to rely on inheritance.
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #4639 on: March 31, 2017, 12:41:53 AM »

Have been wanting Reflection for C++ for ages. It would make a surprisingly large set of tasks much easier. Serialisation being the prime example. But well... current state is they're aiming for C++20. If they also get modules, concepts, string_view finally into C++ and compilers catch up soon, I'd be happy.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Pages: 1 ... 230 231 [232] 233 234 ... 279
Print
Jump to:  

Theme orange-lt created by panic