Author : afisher


Reply
Reply
 
Thread Tools Display Modes
renderhjs's Avatar
Old (#1)
race game project

just some personal in between project to test out new ideas booth technically and design wise. Because I am doing often work that is scattered over different territories such as scripting, modeling, texturing,... this is a thread that shows my progress in order to get inspired by others and perhaps to inspire people.


My first spark of idea was this technical drawing:

the idea is to have a engine that loads 3d mesh tiles and bends or transforms them along a spline path within the engine. That way the track can be:
- more smooth and natural
- consuming less memory booth bandwidth and RAM wise
- easier to compute some kind of rough clipping mechanic to sort out which objects are visible within the view and which not- because you can always only see a section of the spline you are on.
easier to model the 3d models of the road - because they are linear and will be bended within the engine.

then I started downloading the newest FlexSDK (free compiler to write Flash PLayer 10 stuff) and FlashDevelop (a free flash coding environment) and experimented with some of the new Flash Player 10 features such as triangle rendering and vector objects.
My first results looked very promising so I researched on games of the past that I liked to see how they did certain things. NFS came to my mind as its together with NFS2 my favorite NFS game.

I think that the average triangle count for each vehicle is roughly about 128 - 160 triangles.

So created some test subjects to see how it would do in my engine, Those models were:



But before I could use them I wrote some maxscript to write binary files into a custom file format that the flash engine can read (simplified triangulated + UV data)

its a nice workflow because I can select multiple objects, select a folder and then export them with a single click into that folder. Somewhat the same for importing - it creates a multi selection list of the files within a folder so that I can deselect some items and then update scene objects.

you can have a look at a online demo the engine yourself:
http://www.renderhjs.net/bbs/polycou...RaceEngine.swf
controls:
- mouse move = rotate / zoom camera
- mouse wheel = change resolution
- click = see wireframe + object screen clipping boxes

my next steps are to pin down the spline code so that I can display it already in the engine.
Offline , veteran polycounter, 3,037 Posts, Join Date Mar 2008, Location Sydney Australia Send a message via AIM to renderhjs Send a message via MSN to renderhjs  
   Reply With Quote

nrek's Avatar
Old (#2)
Dude Render you are a beast! I love this project. The cars, track and everything look great in the demo swf. Cant wait to see more.
Offline , polygon, 698 Posts, Join Date Jul 2008, Location Bellevue WA Send a message via AIM to nrek Send a message via MSN to nrek  
   Reply With Quote

Harry's Avatar
Old (#3)
I seriously love the way it looks at 1/2 resolution.
Offline , polycounter, 974 Posts, Join Date Jan 2007, Location melbourne Send a message via MSN to Harry Send a message via Skype™ to Harry  
   Reply With Quote

Yngram's Avatar
Old (#4)
The models/textures look good for such low specs. You're a Flash wizard.

Is most of your work programmed from scratch or do you build upon and mod existing engines?

I've been doing some Actionscript programming in Flex and was wondering if you have any good resources (links, books, or otherwise) that you could point me towards.
Offline , null, 12 Posts, Join Date Sep 2008,  
   Reply With Quote

perna's Avatar
Old (#5)
This wins. You may proceed
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,101 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

Harry's Avatar
Old (#6)
Quote:
Originally Posted by Yngram View Post
Is most of your work programmed from scratch or do you build upon and mod existing engines?

I've been doing some Actionscript programming in Flex and was wondering if you have any good resources (links, books, or otherwise) that you could point me towards.
As a kind of supplement to this question, I'd also like to know how smooth the transition is from AS2 to AS3, as i currently am..... Hmm.... "Competent" in AS2 but havent touched AS3 at all. Your stuff is inspiring me to try, but if it's like an epic time investment maybe I should stick to modelling for now...
Offline , polycounter, 974 Posts, Join Date Jan 2007, Location melbourne Send a message via MSN to Harry Send a message via Skype™ to Harry  
   Reply With Quote

DrillerKiller's Avatar
Old (#7)
It is true, you do rock.
Offline , spline, 173 Posts, Join Date Oct 2007, Location toronto  
   Reply With Quote

renderhjs's Avatar
Old (#8)
Quote:
Originally Posted by Harry View Post
I seriously love the way it looks at 1/2 resolution.
so do I, and because of the reduced resolution it even runs smooth on a 1.1 Ghz computer here.
I even planned on using it as a style, see:

It shows some technical and visual effects I want to try out- see if I can get them in real time working.

This project is much about nostalgia about what I have memories back when I played in my 2nd half of my childhood (dos, psx,..).
And mixed with that I want to focus on 80s and 90s elements such as cars, environments and atmosphere.


On the technical side I already got the spline path working (green = input vector path)

but I need to normalize it using equal distance vectors instead of the now eased ones.
Offline , veteran polycounter, 3,037 Posts, Join Date Mar 2008, Location Sydney Australia Send a message via AIM to renderhjs Send a message via MSN to renderhjs  
   Reply With Quote

renderhjs's Avatar
Old (#9)
hmm seems more people responded o_O

Quote:
Originally Posted by Yngram View Post
Is most of your work programmed from scratch or do you build upon and mod existing engines?
I've been doing some Actionscript programming in Flex and was wondering if you have any good resources (links, books, or otherwise) that you could point me towards.
all and each time a completely new engine from scratch, I don't like complicated, hyped frameworks that suggest to not think about how things are handled. It's a personal thing.
I wrote my last engine (no media available, not yet released for public) for a big commercial project and learned a lot from that one. It was a big mix of rendered sprites and realtime polygons which is why I also went more into 3dsmax maxscript development, its something I just like blending different territories with each other.

Resources: some time ago I was active at the flashkit.com board games community and I wrote some 3d related tutorials/ threads there:
- 80 lines 3d engine with texture mapping:
http://board.flashkit.com/board/showthread.php?t=778852
- curing colors tech thread:
http://board.flashkit.com/board/show...hp?t=760371#17
- skewing/transforming triangles with mapping
http://board.flashkit.com/board/show...72#post3818672
- binary format exporting / reading
http://board.flashkit.com/board/showthread.php?t=759766


Other resources that I perhaps can recommend:
- kirupa 3d section
http://www.kirupa.com/developer/acti...pt/3dindex.htm

and google image search I use it a lot to break down stuff I don't get number wise and instead study wireframe/ editor shots of other engines. It tells me often much more as some tech nut trying to explain me higher math stuff with just text.

Quote:
Originally Posted by Harry View Post
As a kind of supplement to this question, I'd also like to know how smooth the transition is from AS2 to AS3, as i currently am.....
well I know that you also know other languages and since AS3 is almost 99% identical with JavaScript because of the ECMA standard (and even pushing it faster as the consortium itself can) it should not be a to big step for your to try it out.
You have to deal with packages and class stucture but once used to it, it gives you also some advantages. My main reason to even continue with flash and switch to AS3 was speed - I dont care about anything else, as long as it executes 10x faster which it did back then.
Now with Flash Player 10 you have vector arrays (single type arrays with linear sequence and a possible fixed length) that boost the performance again and some simplified interface for rendering triangles with texture mapping.


I don't mind stripping here (show some technical background stuff) so if you guys want i can PM you the source Code (its not the big yet, like 3 classes for the rendering, 3 for the data handling and 2 handling the scene/ start). Its all work in progress but maybe you might learn something from it.
Offline , veteran polycounter, 3,037 Posts, Join Date Mar 2008, Location Sydney Australia Send a message via AIM to renderhjs Send a message via MSN to renderhjs  
   Reply With Quote

Yngram's Avatar
Old (#10)
Quote:
Originally Posted by renderhjs
I don't mind stripping here (show some technical background stuff) so if you guys want i can PM you the source Code...
I would appreciate this very much. I haven't delved into any 3D AS3 programming at all yet, though I have picked up a couple of books that cover some simple examples. It would be great to see your working code.

Thanks for the links as well. I'll be sure to check them all out.

Also, your new concept looks sweet. I'm interested in seeing how much you can accomplish without Flash bogging down.
Offline , null, 12 Posts, Join Date Sep 2008,  
   Reply With Quote

JasonLavoie's Avatar
Old (#11)
Render you're crazy man, I always look forward to your new projects Looking forward to the progression, weop!
Jason Lavoie | Environment Artist - Digital Extremes | enviro wiki | The Game Dev Cast
Offline , card carrying polycounter, 2,396 Posts, Join Date Jan 2005, Location London, Ontario  
   Reply With Quote

Frump's Avatar
Old (#12)
This is awesome. I can't wait to see how the spline track system works out and then do some racing. I really like the nostalgia filter. Cool idea.

Last edited by Frump; 08-12-2009 at 08:14 PM..
Kyle Parsons
Available for Freelance / Full-time
Offline , polycounter, 1,262 Posts, Join Date Mar 2009, Location Vancouver, BC Send a message via MSN to Frump  
   Reply With Quote

Harry's Avatar
Old (#13)
Quote:
Originally Posted by renderhjs View Post
hmm seems more people responded o_O
<heaps of cool stuff>
Thanks for the info bro. I think I might try AS3 out after all. The links seem quite useful. As for the differences between AS2 and 3, they actually make me more interested to try it out rather than shy away from it. I'm also very intrigued by an 80 line renderer... No initialisation or fucking around just getting the API to work...
About your source code, It would probably fall on deaf ears for me until I get a decent grip on AS3, but if you're really not fussed about showing it, I'll keep it somewhere til i can make sense of it.
In return if theres any little monkey tasks youd like help with you're welcome to contact me for them - if you feel my abilities might be beneficial to you. I understand if you prefer to do as much as you can yourself (as I do too) but consider this a gesture - I am quite grateful you took time to make such a detailed response.

Last edited by Harry; 08-12-2009 at 08:43 PM..
Offline , polycounter, 974 Posts, Join Date Jan 2007, Location melbourne Send a message via MSN to Harry Send a message via Skype™ to Harry  
   Reply With Quote

Ben Apuna's Avatar
Old (#14)
renderhjs it's really awesome to see you pushing the tech as far as it can go. It's even cooler because you share your progress, experiences, and thought process right here on Polycount for all to see and learn from. Thank you very much

So why haven't you made a fortune already? and start up your own AAA dev studio? ;)
Offline , veteran polycounter, 2,520 Posts, Join Date Feb 2009, Location Hawaii Send a message via Yahoo to Ben Apuna  
   Reply With Quote

acidrain's Avatar
Old (#15)
This is incredible. I've been playing with AS3 and PaperVision3D at work and I just thought there had to be a better way. A simple app that renders 12 planes which swivel along the Y-axis ended up compiling to over a megabyte because of all that extra library junk. Not to mention it had my CPU pegged at ~60% the whole time.

I'm definitely going to be studying your 80 line 3d engine to see how you do it because pv3d is complete overkill for what I'm doing.
Offline , vertex, 25 Posts, Join Date Sep 2008, Location British Columbia, Canada  
   Reply With Quote

renderhjs's Avatar
Old (#16)
Quote:
Originally Posted by Ben Apuna View Post
...So why haven't you made a fortune already? and start up your own AAA dev studio? ;)
I got myself a nice job and about to move soon

@Acidrain: I can PM you the source as well - its not big yet and probably easier to overlook. The most vital and important parts are the cam.get2d method and the rendering class that loops through the objects and faces to display the triangles, focus on those and you might be able to understand or learn from it.

That 80 line code thing is nice if you work for Flash Player 9 because of the affine texture mapping the code covers - but in Flash Player 10 its already included, besides that it does not feature perspective, instead it gets projected orthogonal (like iso views, because its easier to explain).


some update:

because I normalized the spline (a new spline with equal distances instead of eased different ones) I can really quick predict the position on the spline unit wise. This is important to later:
- transform meshes that need to be bended along the spline
- determine where objects are clipped
- position objects along the spline (transform linear X,Y,Z coordinates to aside spline X,Y,Z coordinates)

here is a online demo about it:
http://www.renderhjs.net/bbs/polycou...RaceEngine.swf
controls:
- xMouse = defines position
- yMouse = defines draw distance
Offline , veteran polycounter, 3,037 Posts, Join Date Mar 2008, Location Sydney Australia Send a message via AIM to renderhjs Send a message via MSN to renderhjs  
   Reply With Quote

rasmus's Avatar
Old (#17)
yer a beast indeed, render. keep it up.
Rasmus Deguchi - LinkedIn
Independent Game Developer
www.razkun.com
Offline , polycounter, 810 Posts, Join Date Dec 2007, Location Tokyo, Japan  
   Reply With Quote

Harry's Avatar
Old (#18)
Quote:
Originally Posted by renderhjs View Post
THIS GUY IS AWESOME
Offline , polycounter, 974 Posts, Join Date Jan 2007, Location melbourne Send a message via MSN to Harry Send a message via Skype™ to Harry  
   Reply With Quote

Pedro Amorim's Avatar
Old (#19)
fucking hell man!
what can't you do?
Weapons Artist @ Crytek UK
www.edgesize.com » pedro amorim portfolio
blog.edgesize.com » digital playground
Offline , veteran polycounter, 2,632 Posts, Join Date Mar 2005, Location Nottingham, UK Send a message via ICQ to Pedro Amorim Send a message via AIM to Pedro Amorim Send a message via MSN to Pedro Amorim Send a message via Skype™ to Pedro Amorim  
   Reply With Quote

Ben Apuna's Avatar
Old (#20)
Quote:
Originally Posted by renderhjs View Post
I got myself a nice job and about to move soon
...
That's awesome! congrats on finding a good job
Offline , veteran polycounter, 2,520 Posts, Join Date Feb 2009, Location Hawaii Send a message via Yahoo to Ben Apuna  
   Reply With Quote

Minos's Avatar
Old (#21)
Nice stuff, I like where this is going =)
Thiago Klafke / Environment Artist
Portfolio - Linkedin
Offline , polygon, 686 Posts, Join Date May 2007, Location Sao Paulo  
   Reply With Quote

SimonT's Avatar
Old (#22)
This is cool. I hadn't time to read all your text but watching the demos is fun. I hope i can drive with the cars soon
Offline , polycounter, 982 Posts, Join Date Feb 2006, Location Aachen, Germany  
   Reply With Quote

acidrain's Avatar
Old (#23)
Quote:
Originally Posted by renderhjs View Post
@Acidrain: I can PM you the source as well - its not big yet and probably easier to overlook. The most vital and important parts are the cam.get2d method and the rendering class that loops through the objects and faces to display the triangles, focus on those and you might be able to understand or learn from it.
Sure - that would be great. Thanks.
Offline , vertex, 25 Posts, Join Date Sep 2008, Location British Columbia, Canada  
   Reply With Quote

okno's Avatar
Old (#24)
This looks really good. Can't wait to see more.
Offline , spline, 215 Posts, Join Date Feb 2008, Location UK  
   Reply With Quote

GCMP's Avatar
Old (#25)
Nice work man, making a game engine is something I would love to do. I'm sure it won't be long before your swimming in the cash you deserve, maybe you are already!

ps: are you planning on releasing a commercial product at some stage?
Offline , dedicated polycounter, 1,473 Posts, Join Date Apr 2008, Location United Kingdom Send a message via Yahoo to GCMP  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch