News:

Function Finder  Find all the functions within source code files

Main Menu

Monkeybot's Latest WIP - Teathered lunar lander

Started by monkeybot, October 28, 2013, 05:21:14 PM

Previous topic - Next topic

monkeybot

Latest Version 12-1-14  :-\

http://www.underwaredesign.com/forums/index.php?topic=4101.msg27901#msg27901



 

v1 - 29/10/13
v2 - 31/10/13
V3 - 10/01/14
V4  -12/01/14

BlinkOk

lookin good monkey dude. are those flat colours draw or are they a big bitmap?


kevin


  Thrust was a bit of favorite back in the day.   Seems like it's all coming together pretty well, although it's running a bit slow here.   

BlinkOk


monkeybot

#5
Quote from: kevin on October 28, 2013, 11:45:27 PM

 Thrust was a bit of favorite back in the day.   Seems like it's all coming together pretty well, although it's running a bit slow here.  

yes.i need to speed it up .it runs quite well on my i5 although it seems to slow down over time,i am fairly sure i am not leaking memory or types,i will look into other ways of doing the landscape.
Basically at the mo it is a massive sprite,would it be better to chop the sprites up or use images or use a world?

the reason i used sprites was for the collision,but i am open to ideas...

Quotesorry didnt see the download

That's what i thought ;-)

kevin

#6
Quoteyes.i need to speed it up .it runs quite well on my i5 although it seems to slow down over time,i am fairly sure i am not leaking memory or types,i will look into other ways of doing the landscape.

  As environments get bigger, the object scope is  generally broken into zones or multiple lists to split worlds into manageable parts.  Effectively getting rid of overhead from processing redundant objects in the game world.   So when the world is 100x * 100y screens in size or something and player is in the screen region 1x,1y    the character refresh/update code isn't wasting time stepping the logic of characters and effects outside of say a 2 by 2 radius of the camera.

  The simplest is the an immediate object list  (which only contains characters within a set range of the camera) and then static or world view list.   As the camera gets near to the objects in world list, the character is checked out of the world list and added to the immediate list to be processed each frame.    So there can be 1000's of characters in the world, but only a fraction of those are only ever active.      


Quote
Basically at the mo it is a massive sprite,would it be better to chop the sprites up or use images or use a world?

the reason i used sprites was for the collision,but i am open to ideas...

 That's far from ideal.  When two sprite objects overlap and you compare pixels then it's basically drawing (span converting) both objects at pixel level every time.   If no hard pixels overlap then it costs probably twice or more than drawing it.    So if you have lots of characters off screen for example,  then a lot of time each frame is lost just making redundant comparisons.

 I wouldn't use sprites for the world, i'd either use Maps or manually processed images.   You can run collisions on maps and those methods are designed with early rejection in mind, making them far more efficient then sprite level collisions.

 For this type of game i'd most likely use vector collision, since Worlds have things like nearest collider built in.  Which means you can query the world for how far away from the something hard the character is.  If it's too far way then collisions with the ground/tunnel become point less.


 Example: Hell Eagle (Map / Level Mock Up)



kevin


Checked the update and it runs faster here,  showing a 1500+ FPS rate, which is seem pretty bogus when in windowed mode.   

Also, might i recommend adding a new post about updates in future, otherwise people have to notice the original edits.


stevmjon

hey monkey,

this is fun to play. I like the inertia you made. very smooth.

my computer runs at 4400+ frames. maybe you could put a limit on it as to not max out a cpu core?

also, could you add option of ASDW keys for control of ship, because I am too used to this.

   keep up the good work,  stevmjon
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

monkeybot

Duly noted,thanks for the feedback.
i will put an option in to redefine the keys.

i have found that i get much smoother gameplay when i throttle the framerate with a timer hence the seemingly high fps count.

monkeybot

#10
New update !!

10-1-14


A lot of work has gone on behind the scenes.

Check it out!

Still needs loads more work.

Thanks to BlinkOk for the Sub and some nice ideas!

kevin


tried it, but it's way too slow to be playable here

monkeybot

#12
hmmm thats strange it runs well on mine.will investigate.

I find that it runs fine on my i5 which is not exactly cutting edge.

If i use setfps(50) the game seems to run really jerkily if i employ a timer of 1000/50 then it all runs very smoothly,any ideas?
its running in 9ms a frame on my machine.

i just found another sync in the loop.oops!
New version up.

kevin


The update runs at playable enough speed. 


QuoteIf i use setfps(50) the game seems to run really jerkily if i employ a timer of 1000/50 then it all runs very smoothly,any ideas?
its running in 9ms a frame on my machine.

  It's most likely not releasing any time back to windows, where  Sync does when SetFps is enabled.    The latter is far more system friendly. 


monkeybot

#14
is it strictly necessary to give cycles back to winblows when playing a full screen game?


EDIT: YES