Game Main Loop Timing (desiring feedback) (solved)

Game development specific discussions.
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: Game Main Loop Timing (desiring feedback) (solved)

Postby leopardpm » Dec 10, 2018 20:31

paul doe wrote:Goal Based Vector Field Pathfinding.
That's all the pathing you'll ever need to achieve really complex behavior for thousands of agents at the same time, and then some more, with minimal computational cost. And it's trivial to implement to boot.

yes... basically the heat map/flow map/influence map... I know and am already incorporating them, as much as possible - I gladly trade memory for speed any day! (within reason, of course!)

The problem is when both ends of the path are dynamic - flow map necessitate static goals - all the trees in the world, or some such - you would have to re-generate the flow map every time one of the path ends (goal) changed location.

@leopardpm: You should really start looking to learn OOP. Especially Design Patterns, such as the Command pattern, can provide the distributed solution you seek.
I agree that I 'should', but whenever I tried, it really blew my mind because ever since I was 9 yrs old (first started programming 42 yrs ago...ug), I only have done things procedurally. Since I have a hard enough time completing things doing them the 'old way', I don't think I could ever learn a 'new way' and be more efficient.... my thinking is procedural, cause/effect. one thing after another, etc....
paul doe
Posts: 886
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Game Main Loop Timing (desiring feedback) (solved)

Postby paul doe » Dec 10, 2018 20:42

leopardpm wrote:...
The problem is when both ends of the path are dynamic - flow map necessitate static goals - all the trees in the world, or some such - you would have to re-generate the flow map every time one of the path ends (goal) changed location.

No. And with A* you would have the same problem, but far worse (need to compute the entire map for each pathing entity!). You see, they were invented precisely for that: highly dynamic environments. You can do the changes when and where they are needed (using a variation of the Brushfire Algorithm), so the vector field needs to be recomputed when something static (such as a tree) changes (the tree is chopped).
What is so 'complex' about the behavior you need for the agents, anyway? We're talking The Sims, or Dwarf Fortress like agents?

leopardpm wrote:I agree that I 'should', but whenever I tried, it really blew my mind because ever since I was 9 yrs old (first started programming 42 yrs ago...ug), I only have done things procedurally. Since I have a hard enough time completing things doing them the 'old way', I don't think I could ever learn a 'new way' and be more efficient.... my thinking is procedural, cause/effect. one thing after another, etc....

And what is so complicated that it 'blew your mind'? FreeBasic has a really nice object model to learn about OOP (not so much for doing 'production' code, alas), that's quite accessible, so it's now or never =D
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: Game Main Loop Timing (desiring feedback) (solved)

Postby leopardpm » Dec 10, 2018 20:56

paul doe wrote:You can do the changes when and where they are needed (using a variation of the Brushfire Algorithm), so the vector field needs to be recomputed when something static (such as a tree) changes (the tree is chopped).
I will look into the Brushfire Algo... I have been thinking about how to recompute just a portion of a field related to a single object... I bet this Brushfire method is the same as my own...

What is so 'complex' about the behavior you need for the agents, anyway? We're talking The Sims, or Dwarf Fortress like agents?
The more complex, the better.... DF does a decent job, but most of the heavy lifting (direction) is provided by the player who directs the dwarfs through designating things to do (dig these squares, etc) - the dwarves have behaviors that are GOAPish but have limited 'brain' AI... they figure out if they are hungry/sick/etc but only a few things.... yes, DF is part of my inspiration

The Sims tackle things from a different angle, with objects broadcasting what they do and how to use them - I don't like the method but it seems to be relatively effective... don't think this will work for my ultimate end goal though....

leopardpm wrote:I agree that I 'should', but whenever I tried, it really blew my mind because ever since I was 9 yrs old (first started programming 42 yrs ago...ug), I only have done things procedurally. Since I have a hard enough time completing things doing them the 'old way', I don't think I could ever learn a 'new way' and be more efficient.... my thinking is procedural, cause/effect. one thing after another, etc....

And what is so complicated that it 'blew your mind'? FreeBasic has a really nice object model to learn about OOP (not so much for doing 'production' code, alas), that's quite accessible, so it's now or never =D
I am quite sure that you are entirely correct.... I am just obstinate.... perhaps I will be forced to learn OOP style someday, but meanwhile I really enjoy figuring out how to solve problems with the current (but perhaps limited) methods that I already understand. You really are pushing for OOP, huh?

EDIT: these last posts are getting way off topic. I suggest we start another thread or two ("Why Learn OOP?" & "Game NPC AI ideas" possibly) if we want to continue the discussion in those veins... or you are free to email me directly at Lxexoxpxaxrxdxpxm-at-yxaxhxoxox-dot-cxoxmx (leaving out the 'x's of course!)
paul doe
Posts: 886
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Game Main Loop Timing (desiring feedback) (solved)

Postby paul doe » Dec 10, 2018 21:21

leopardpm wrote:...I bet this Brushfire method is the same as my own...

Probably. There are several variants, one of which is used to produce a vector field for different sized units.
leopardpm wrote:...The more complex, the better...

For what purpose?
leopardpm wrote:... don't think this will work for my ultimate end goal though...

Which is?
leopardpm wrote:...You really are pushing for OOP, huh?

Not really. I'm pushing the 'use the right tool for the right job' philosophy. If you're on consoles, you shouldn't even consider OOP, for example. But in many cases such as this, using OOP techniques can greatly simplify your work. Once you learn the advantages of using polymorphic code, you won't want to go back.

Some time ago, there was a proposal for an entirely AI-driven spaceship battle (see here). That would be a perfect example of how some simple OOP techniques can get you much farther than simply using procedural. They tackle the same problems but with a different approach (OOP = inherently dynamic vs Procedural = inherently static).

leopardpm wrote:EDIT: these last posts are getting way off topic. I suggest we start another thread or two ("Why Learn OOP?" & "Game NPC AI ideas" possibly) if we want to continue the discussion in those veins... or you are free to email me directly at Lxexoxpxaxrxdxpxm-at-yxaxhxoxox-dot-cxoxmx (leaving out the 'x's of course!)

That's up to you, of course. Fair enough for me.
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: Game Main Loop Timing (desiring feedback) (solved)

Postby leopardpm » Dec 10, 2018 21:40

paul doe wrote:
leopardpm wrote:EDIT: these last posts are getting way off topic. I suggest we start another thread or two ("Why Learn OOP?" & "Game NPC AI ideas" possibly) if we want to continue the discussion in those veins... or you are free to email me directly at Lxexoxpxaxrxdxpxm-at-yxaxhxoxox-dot-cxoxmx (leaving out the 'x's of course!)

That's up to you, of course. Fair enough for me.
Ok, creating a thread regarding AI... will add a link here when done. But, beware, its a topic near and dear to my heart and could easily get lengthy with all manners of 'walls of text'.... mostly just spouting off opinions and dreams...
badidea
Posts: 1247
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Game Main Loop Timing (desiring feedback) (solved)

Postby badidea » Dec 10, 2018 22:26

I was reading 'Bushfire Algorithm' instead of 'Brushfire Algorithm' initially. I guess the first one is the more violent version :-)
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: Game Main Loop Timing (desiring feedback) (solved)

Postby leopardpm » Dec 10, 2018 23:17

badidea wrote:I was reading 'Bushfire Algorithm' instead of 'Brushfire Algorithm' initially. I guess the first one is the more violent version :-)
lol!

I haven't been able to find much on the Brushfire algo yet.... some things on Flow Fields, but not Brushfire tehniques...
leopardpm
Posts: 1791
Joined: Feb 28, 2009 20:58

Re: Game Main Loop Timing (desiring feedback) (solved)

Postby leopardpm » Dec 10, 2018 23:18

link to thread talking about a 'more complex AI'...

https://www.freebasic.net/forum/viewtopic.php?f=15&t=27222

link to thread figuring out ways to make Heatmaps more Dynamic... maybe the above mentioned 'Brushfire algo' which I cannot find info on...

https://www.freebasic.net/forum/viewtopic.php?f=15&t=27223

Return to “Game Dev”

Who is online

Users browsing this forum: No registered users and 1 guest