3D polygon world render

Game development specific discussions.
Gunslinger
Posts: 12
Joined: Mar 08, 2016 19:10

3D polygon world render

Postby Gunslinger » Feb 22, 2017 23:16

Hello Everyone,

I have been working on my one 3D render and i like to show some pictures and source if you like.
I call it a low-polygon cartoon style 3D.
Never did think to make it this far.

Here is a picture i like http://ac1.servegame.com:88/Screens/Screenshot03.png
some older pictures are
http://ac1.servegame.com:88/Screens/Screenshot02.png
http://ac1.servegame.com:88/Screens/Screenshot01.png
http://ac1.servegame.com:88/Screens/Screenshot04.png

The world render code is a 16x16x16 chunk area by default and containing points, triangle and lights in range.
it supports VR-mode with a big frame-rate impact :)
My plan is to send the chunks over internet for a multiplayer game, but i have a lot to do.
I have modified D.J.Peters polygon for it http://www.freebasic.net/forum/viewtopic.php?f=7&t=23271&p=227109#p227109
And i'm still learning the freebasic languages on my one way.

Tell me what you think.
thesanman112
Posts: 538
Joined: Jul 15, 2005 4:13

Re: 3D polygon world render

Postby thesanman112 » Apr 15, 2017 15:17

Looks good....f14 kamakzee is a game i developed in freebasic going back many years...it took me over a year of prgramming to get a good working demo whipped up..realms of darkness was another...notbsure if itnwould still be on this server or not.
Gunslinger
Posts: 12
Joined: Mar 08, 2016 19:10

Re: 3D polygon world render

Postby Gunslinger » Oct 07, 2018 21:21

Update 2
I got back on it. https://youtu.be/gB4ajrh-aU0
Now loads from STL 3D files.

The 200 trees are objects and the cubes are dropped in solid world.
Moving light is still not on the objects.
Last edited by Gunslinger on Oct 08, 2018 22:34, edited 1 time in total.
dafhi
Posts: 1220
Joined: Jun 04, 2005 9:51

Re: 3D polygon world render

Postby dafhi » Oct 08, 2018 4:32

thanks for sharing :-)
paul doe
Posts: 803
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: 3D polygon world render

Postby paul doe » Oct 08, 2018 4:46

Gunslinger wrote:I have been working on my one 3D render and i like to show some pictures and source if you like...

A little source code would be nice, I think ;)
Gunslinger
Posts: 12
Joined: Mar 08, 2016 19:10

Re: 3D polygon world render

Postby Gunslinger » Oct 08, 2018 22:33

paul doe wrote:
Gunslinger wrote:I have been working on my one 3D render and i like to show some pictures and source if you like...

A little source code would be nice, I think ;)


The source code is not little any more.
So many thing to improve and cleanup.
here you go. http://ac1.servegame.com:88/download/ArcherCraft%20by%20Gunglinger.zip

I think i can use pointers in triangles data type to improve performance.
Let me know if you have any tips. :-)
paul doe
Posts: 803
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: 3D polygon world render

Postby paul doe » Oct 09, 2018 0:35

Gunslinger wrote:Let me know if you have any tips. :-)

Nice! Didn't take a really depth look, but for now I can tell you that it freezes the process after a while. Are you using getMouse() in another thread? It is either this, or you're having a race condition somewhere in the code.

One tip for now: the movement speed varies wildly with the framerate (~14-45 FPS here). You need to either:
  • Take the rendering time into account when doing the update (see here)
    - Or -
  • Implement a framerate independent update loop (see here)

Pretty good work, considering it's rendered all in software!
Gunslinger
Posts: 12
Joined: Mar 08, 2016 19:10

Re: 3D polygon world render

Postby Gunslinger » Oct 09, 2018 11:15

paul doe wrote:
Gunslinger wrote:Let me know if you have any tips. :-)

Nice! Didn't take a really depth look, but for now I can tell you that it freezes the process after a while. Are you using getMouse() in another thread? It is either this, or you're having a race condition somewhere in the code.

One tip for now: the movement speed varies wildly with the framerate (~14-45 FPS here). You need to either:
  • Take the rendering time into account when doing the update (see here)
    - Or -
  • Implement a framerate independent update loop (see here)

Pretty good work, considering it's rendered all in software!


Thanks, Freezes happens when the video buffer is to small.
It wil do a redim preserve for more room as many times as needed.
That array is very big so it freezes a bit, over times it will stop doing that.

And i know about frame rate, just like to see how high it gets.
When i move up way from the world the fps go to 300+ and i rocket of in space :)
Last edited by Gunslinger on Oct 09, 2018 20:37, edited 1 time in total.
paul doe
Posts: 803
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: 3D polygon world render

Postby paul doe » Oct 09, 2018 13:10

Gunslinger wrote:Thanks, Freezes happens when the video buffer is to small.
It wil do a redim preserve for more room as many times as needed.
That array is very big so it freezes a bit, over times it will stop doing that.

Yes, but it shouldn't freeze the app. Also, why such a simple scene uses an inordinate amount of memory? Task Manager reports a usage of ~888 MB here (!)
Gunslinger wrote:And i know about frame rate, just like to see how high it gets.
When i move up way form the world the fps go to 300+ and i rocket of in space :)

Perhaps, but that also shouldn't happen. By decoupling the updating from the rendering, you can move at a consistent speed while still allowing the renderer to go as fast as your hardware can handle. See this article for details: https://www.koonsolo.com/news/dewitters-gameloop/
badidea
Posts: 1008
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: 3D polygon world render

Postby badidea » Oct 09, 2018 18:52

Awesome :-)

Change:
#include "include/keyboard.bi" to #include "Include/keyboard.bi"
And delete:
#if defined(__FB_WIN32__) block in LP3_data_type.bi
And it runs under linux fbc32 and fbc64 bit as well.

Movement with mouse-pad is a bit annoying.

Three months to turn it into a game: viewtopic.php?f=17&t=27069
BasicCoder2
Posts: 3308
Joined: Jan 01, 2009 7:03

Re: 3D polygon world render

Postby BasicCoder2 » Oct 09, 2018 19:35

Cool demo. Can the code be used to make something like this?
https://www.youtube.com/watch?v=8piDU5UFA68
I remember the fun of learning to land on the air craft carrier without crashing. Flying under the Golden Gate bridge and over Alcatraz.
Looking back on some of the old software I have to take my hat off to the clever programmers of the time who had to make do with little memory and slow computers. Of course the Amiga did have special graphics hardware for some things such as drawing and filling in polygons.
I remember Mark Silby of Blitz Basic fame making a simple 3d demo of flying around the three pyramids and thought it would be cool to be able to do that myself.
Gunslinger
Posts: 12
Joined: Mar 08, 2016 19:10

Re: 3D polygon world render

Postby Gunslinger » Oct 09, 2018 20:32

BasicCoder2 wrote:Cool demo. Can the code be used to make something like this?
https://www.youtube.com/watch?v=8piDU5UFA68
I remember the fun of learning to land on the air craft carrier without crashing. Flying under the Golden Gate bridge and over Alcatraz.
Looking back on some of the old software I have to take my hat off to the clever programmers of the time who had to make do with little memory and slow computers. Of course the Amiga did have special graphics hardware for some things such as drawing and filling in polygons.
I remember Mark Silby of Blitz Basic fame making a simple 3d demo of flying around the three pyramids and thought it would be cool to be able to do that myself.


I think this can do better then that game. The number of triangles i have is insane and uses like 800mb just to load the world.
Sins the world in my code is made of areas(chunks) so i can load chunks from disk and unload unused chunks, if needed.
The core code is far from complete.

And you bring me memories of F29 Retaliator (DOS game)
https://www.youtube.com/watch?v=gXdfsFYX-XU
Gunslinger
Posts: 12
Joined: Mar 08, 2016 19:10

Re: 3D polygon world render

Postby Gunslinger » Oct 09, 2018 21:14

paul doe wrote:
Gunslinger wrote:Thanks, Freezes happens when the video buffer is to small.
It wil do a redim preserve for more room as many times as needed.
That array is very big so it freezes a bit, over times it will stop doing that.

Yes, but it shouldn't freeze the app. Also, why such a simple scene uses an inordinate amount of memory? Task Manager reports a usage of ~888 MB here (!)
Gunslinger wrote:And i know about frame rate, just like to see how high it gets.
When i move up way form the world the fps go to 300+ and i rocket of in space :)

Perhaps, but that also shouldn't happen. By decoupling the updating from the rendering, you can move at a consistent speed while still allowing the renderer to go as fast as your hardware can handle. See this article for details: https://www.koonsolo.com/news/dewitters-gameloop/


I had a look in memory use and i found the world reserved 4-8 times more then needed areas.
And i am sure more things are big. Got it down to 200mb on 32-bit.

I will look in the frame rate game speed issue, thanks for the link.
The plan is to have everything timer based speeds.


@badidea
Three months to turn it into a game, i'm not sure if that is possible.
Maybe something for fun.
And mouse-pads are always annoying, but works fine here.

Return to “Game Dev”

Who is online

Users browsing this forum: No registered users and 1 guest