Oxygen Basic

Programming => Example Code => Topic started by: Peter on October 01, 2013, 05:28:32 AM

Title: Windows Api Game Section
Post by: Peter on October 01, 2013, 05:28:32 AM
Deleted
Title: Re: Windows Api Game Section
Post by: kryton9 on October 01, 2013, 12:59:22 PM
I'm getting an error Peter. Can you include your script and .exe also in your ufo.zip?
Title: Re: Windows Api Game Section
Post by: JRS on October 01, 2013, 02:27:56 PM
Quote
I don't know errors, I am perfect!

I would like an MD5 done on that statement just to be sure.  :D
Title: Re: Windows Api Game Section
Post by: kryton9 on October 01, 2013, 06:33:12 PM
Thanks, I like these types of games.
Title: Re: Windows Api Game Section
Post by: Haim on October 01, 2013, 08:12:28 PM
Very nice game!
Thanks for your work!
Title: Re: Windows Api Game Section
Post by: Emil_halim on October 02, 2013, 07:15:18 AM

Hi peter ,

as usual are prove that you are great gamer man.

just want to tell something , using windows API for game is not a correct direction , becasue it is very slow ,
instead you can use directX ot opnegl interface.

BTW i will thinking to emulate your simple library with my MagicPro to allow your games work with my library.

thanks.     
Title: Re: Windows Api Game Section
Post by: Emil_halim on October 02, 2013, 08:40:07 AM
well , from now on i will call you as peter GGM.  :)

ofcorse  GGm means Great Gamer Man.
Title: Re: Windows Api Game Section
Post by: Haim on October 07, 2013, 07:53:52 PM
Great,
I am very impressed, (even though I am too old to finish even the first map)
Thanks,
Title: Re: Windows Api Game Section
Post by: Aurel on October 08, 2013, 08:53:11 AM
peter
why is game very slow on my computer?
i try to remove sleep 10 in redraw,same thing...
i have also try to set FPS ...again same thing..slow
do i need to set something else to increase speed of game?
Title: Re: Windows Api Game Section
Post by: Aurel on October 08, 2013, 09:53:16 AM
Quote
Surely is your computer too old.
maybe yes...
but how then your older similar game work with good speed on
my really OLD computer?
ok i will try again set FPS... >:(
Title: Re: Windows Api Game Section
Post by: Aurel on October 08, 2013, 10:24:43 AM
Nothing...
Peter...for example your game called
Speedy Bug ...runing fast on same old computer...
where is the catch then?
i just ask...nothing to be upset..ok!
Title: Re: Windows Api Game Section
Post by: Aurel on October 08, 2013, 10:32:48 AM
Peter
it looks to me that is problem in window size..
In SpeedyBug i can resize window or play in full screen but in
any case game is far faster then this new one why is that i really dont know.
Title: Re: Windows Api Game Section
Post by: JRS on October 08, 2013, 11:17:50 AM
Quote from: Emiil
just want to tell something , using windows API for game is not a correct direction , becasue it is very slow ,
instead you can use directX ot opnegl interface.

Nimrod (C) + nimgame
(http://files.allbasic.info/Nimrod/nimgame_ufo.png)

more ... (http://www.allbasic.info/forum/index.php?topic=235.msg2716#msg2716)

Simple Window + SB
(http://files.allbasic.info/ScriptBasic/SBAB.png)
Title: Re: Windows Api Game Section
Post by: Aurel on October 08, 2013, 11:32:49 AM
John
do you can show us how this nimrod game perform directly on windows
and say how much is really fast on windows not on redhat64?
Title: Re: Windows Api Game Section
Post by: Aurel on October 08, 2013, 11:58:22 AM
Quote
Aurel, SpeedBug is OpenGl.
Peter ...
I don't know that speedybug is openGL game , but i think that Oxygen basic
is not slow at all with api games but something is really strange with this game.
Also i try reduce the size of window and i get faster game ???
I simply don't see this problem before in window size... ::)
Title: Re: Windows Api Game Section
Post by: JRS on October 08, 2013, 12:17:55 PM
John
do you can show us how this nimrod game perform directly on windows
and say how much is really fast on windows not on redhat64?

Debunking the misinformed

Title: Re: Windows Api Game Section
Post by: Aurel on October 08, 2013, 12:48:51 PM
ok.
so this is SDL based compiled win32 exe created by nimrod ...right?
do we can download this game?
Title: Re: Windows Api Game Section
Post by: JRS on October 08, 2013, 12:57:37 PM
ok.
so this is SDL based compiled win32 exe created by nimrod ...right?
do we can download this game?

Here are the binaries and source.


.
Title: Re: Windows Api Game Section
Post by: Aurel on October 08, 2013, 09:34:37 PM
Thanks John
Hmm this little game eat 80% of processor and use like you say SDL dll-s.
Title: Re: Windows Api Game Section
Post by: JRS on October 08, 2013, 11:06:25 PM
I think this example is being used as a stress and API tester. I would be willing to give up some of 1800+ FPS back to the processor if I was to use this game toolkit myself. Look at the version level. (.01) That tells me this is the first working version in the author's eye's.
Title: Re: Windows Api Game Section
Post by: kryton9 on October 09, 2013, 12:57:10 PM
I am getting around 300 fps on my netbook and about 60% cpu usage. SDL is not static linked, but I have no idea if that would effect cpu usage... I thought it would only effect the executable size.

Thanks John, I can use this for comparison testing in the coming weeks, to see how executable file sizes vary from nimrod, c and freepascal.
Title: Re: Windows Api Game Section
Post by: JRS on October 09, 2013, 01:10:28 PM
I don't think static linking would provide any performance advantage. Dynamic linking should be the preferred method as only one copy of the shared object is loaded into memory serving multiple processes with each having their own separate data segments. Try loading a Wine application for the first time and then compare loading additional Windows applications. (loads almost instantly) There is a performance gain if your program doesn't have to load (search for) shared objects if they are already in memory.

The only advantage I see of static linking is if the library your using is non-standard and would require installing dependencies.
Title: Re: Windows Api Game Section
Post by: kryton9 on October 09, 2013, 01:46:57 PM
I can't find the other sdl development libraries anymore for Windows. The site has changed dramatically.
Strange. Perhaps they want everyone to migrate to 2.0 version? Will keep looking later tonight.

Title: Re: Windows Api Game Section
Post by: JRS on October 09, 2013, 05:07:08 PM
Code: [Select]
[quote]Perhaps they want everyone to migrate to 2.0 version? Will keep looking later tonight.
I compiled the RTB (Return To BASIC) interpreter on Android with SDL2 and SDL1 (what it was built with) without any issues with the version upgrade.

Title: Re: Windows Api Game Section
Post by: kryton9 on October 09, 2013, 06:53:33 PM
I found all the older libraries and sources tonight for sdl 1.2:
http://www.libsdl.org/projects/

For each SDL extension, when you click on it-- it will take you to the 2.0 version,
but if you look at the top middle of the page, you will see a link for the 1.2 version.
Title: Re: Windows Api Game Section
Post by: kryton9 on October 09, 2013, 07:21:45 PM
I found this demo from the sdl site.
Amazing all the cool things they do with such small code.
Just un7zip and double-click  RunMe.cmd
I wrote the batch script to make it easy to run the demo.
It will play through 2 demos and close when all finished.

Nice inspiration to keep plugging away at all we do!

.
Title: Re: Windows Api Game Section
Post by: JRS on October 09, 2013, 08:52:05 PM
Nice. (running from a Wine console)

(http://files.allbasic.info/AllBasic/sdldemo_wine.png)
Title: Re: Windows Api Game Section
Post by: kryton9 on October 10, 2013, 12:38:35 AM
Thanks for telling me about wineconsole. I didn't know about it. So I tried it out.

The music sounded different than on windows. It could have just seemed like that
because, I had the volume level down very low-- as it is very late here.


.