Looks good (32-bit & 64-bit), a steady 60 Hz. 78% of time sleeping.leopardpm wrote:cool! will implement - how does it work on yours with this code?
Also here at 500 Hz the last digit sometimes different, still pretty stable, no sleeping any more.
Looks good (32-bit & 64-bit), a steady 60 Hz. 78% of time sleeping.leopardpm wrote:cool! will implement - how does it work on yours with this code?
my main problem is that I hyper-focus on insignificant details (esp speed optimizations...) which are unnecessary to the final 'product'...resulting in not finishing anything but a series of discreet (but fast!) routines... but no coherent game...badidea wrote:Meanwhile, my game is not progressing at all. Only helping the competition :-) Need to cut some features, making it too complicated.
Code: Select all
function ACTION1(degraded as boolean, ...)
select case degraded
case false
'do normal stuff
case else
'do fast stuff
end select
end function
'....
'main loop
dim as double cycle_eaten, ellaped = TIMER
do
ACTION1(degradedmode , ...)
cycle_eaten += TIMER - ellapsed
ellapsed = TIMER
if cycle_eaten > somelimit then degradedmode = TRUE
ACTION2(degradedmode , ...)
loop until '...
'end
Yes, but in the context of games, I think that the graphics will be the the most cycle consuming task generally.leopardpm wrote:what you are proposing is a kind of LOD (level of Detail) for actions depending upon how much time is available. This works pretty good for graphics
leopardpm wrote: To try to use LOD in all things at all times to get maximum speed always... this will just be a tremendous effort with possibly NO effect on the program. don't fix a problem that isn't there....
agreed...but...Tourist Trap wrote:Yes, but in the context of games, I think that the graphics will be the the most cycle consuming task generally.
Ah I see. If it's about the modern GPUs you are right, even if I don't have here the kind of modern stuff involved. Anyway I dont know if we can ask a modern GPU, which is something known to host a lot of chips, working in parallel, to do other things than graphics? If possible then, computing multipe agents behaviour in a single pass should be really made faster. I cant remember where I heard something like that for the last time...leopardpm wrote:
My goal is to have MANY realistic agents in the world for the player to interact with and this will be my speed bottleneck, I fear.
yes partial path finding could be a part of the answer, but.....badidea wrote:Sounds like a an idea for a specific task that can take a lot of CPU-time. E.g. 100 AI-enemies trying to find a way to you in a big complex map. Disadvantage is maybe a different game experience on a faster/slower PC. A path finding algorithm that does only path-finding for a part of the path each loop might be better, but maybe more complex to program.