Jump to content


Photo

Large 3d City Map Rendering


  • Please log in to reply
36 replies to this topic

#21 JMike

JMike

    GMC Member

  • New Member
  • 17 posts

Posted 25 September 2008 - 08:30 PM

However: you gonna credit the guy who made those road textures? Lul, I can tell you print screened the box of a guy's item for sale in Second Life.


As noted in the first post the textures are available for download on sketchup 3d warehouse. I don't know who originally made them or what the license agreement is to use sketchup models and textures in games and third party products. I assume that if the 3d warehouse is open for downloading models, they are meant to be used. You can find the textures here:

http://sketchup.goog...mp;prevstart=36

I'm stiff confused though - as to how I add hills to to road.


The hills (or terrain if you will) are created by a couple of sin functions multiplied together, and capped at the ground level. Look in the create_tiles() script.

Hope this helps!

Edited by JMike, 25 September 2008 - 08:31 PM.

  • 0

#22 arkanine

arkanine

    GMC Member

  • New Member
  • 41 posts

Posted 30 September 2008 - 01:53 AM

Well, im sure it wouldve been a great engine. If my car didnt fall through the floor whenever i start.
  • 0

#23 JMike

JMike

    GMC Member

  • New Member
  • 17 posts

Posted 30 September 2008 - 09:31 AM

Yeah, that's a bug when the frame rate drops too low.. I'm working on integrating a better collision system for the next version though..
--Mike
  • 0

#24 Phantom107

Phantom107

    Engineer

  • GMC Member
  • 2599 posts
  • Version:GM:Studio

Posted 30 September 2008 - 10:44 AM

Yeah, that's a bug when the frame rate drops too low.. I'm working on integrating a better collision system for the next version though..
--Mike


I don't see how this could be caused by a low framerate. Or did you link the collisions to room_speed? :lol:
  • 0

#25 Tepi

Tepi

    GMC Member

  • Global Moderators
  • 4201 posts
  • Version:GM8.1

Posted 30 September 2008 - 03:09 PM

Yeah, that's a bug when the frame rate drops too low.. I'm working on integrating a better collision system for the next version though..
--Mike


I don't see how this could be caused by a low framerate. Or did you link the collisions to room_speed? :)

First of all, room_speed is usually a constant and it's not changing according to the framerate, unlike fps. Second of all, I wouldn't doubt that being caused by a low framerate. Not only the fact that I had run to similar results while testing Barnstormer 1920 (was it '20?), but also the fact that there are probably physics involved.

Framerate plays a major part in physics. In real life, the length of second doesn't change. In Game programming, the length of a step (between two execution frames) does change. In speed (=distance / time), and even more, in acceleration (=distance / time squared), the change is visible. The step is one unit when these are executed like (x+=speed; speed+=acceleration) as they usually are.

The bug is caused when values like speed are set to values according to the normal framerate and the fps suddenly changes much, for example 2 (pixels/frame), in 60 fps (second = 60*frames, frame = seconds/60), means that the object travels 2 pixels in 60th of a second, therefore traveling 60*2 = 120 pixels in a second. And then at the start, the fps increases vastly from about 10 fps to 40 fps for example, let's see what happens with the (x+=speed; speed+=acceleration)-system.

First step: fps == 10; x == 0; speed == 2; acceleration == 0.1; these values are converted respectively to seconds:
speed == 2*10=20; acceleration == 0.1*10^2=10
system internal:
x+=speed; -> x=2
speed+=acceleration; -> speed=2.1
visible effect (respectively in seconds):
x+=speed; -> x=20
speed+=acceleration; -> speed=30

Next step: <The fps increases to 40>
system internal:
x+=speed; -> x=4.1
speed+=acceleration; -> speed=2.2
visible effect (respectively in seconds):
(speed == 2.1*40=84; acceleration == 0.1*40^2=160)
x+=speed; -> x=104
speed+=acceleration; -> speed=190

Next step:
system internal:
x+=speed; -> x=6.3
speed+=acceleration; -> speed=2.3
visible effect (respectively in seconds):
x+=speed; -> x=294
speed+=acceleration; -> speed=350

Next step:
<The fps increases to 60>
system internal:
x+=speed; -> x=8.6
speed+=acceleration; -> speed=2.4
visible effect (respectively in seconds):
(speed == 2.3*60=138; acceleration == 0.1*60^2=360)
x+=speed; -> x=432
speed+=acceleration; -> speed=710

So the speed is 710 after 4 steps. If the fps would have stayed the same, the speed would've been 2.4*60=144. The difference is significant. Sorry, I couldn't explain it more easily. :lol:

I'd say the best way to prevent this would be to use delta-time.
  • 0

#26 JMike

JMike

    GMC Member

  • New Member
  • 17 posts

Posted 30 September 2008 - 07:12 PM

Yeah, that's a bug when the frame rate drops too low.. I'm working on integrating a better collision system for the next version though..
--Mike


I don't see how this could be caused by a low framerate. Or did you link the collisions to room_speed? :lol:


There is a particle physics system with rods and springs that keep the particles aligned, this is what is keeping the car from sliding through the ground. But when the frame rate drops too low the physics become unstable and start oscillating until it finally collapses and the car either flies up into the sky or drops below the ground.
  • 0

#27 Commentator

Commentator

    GMC Member

  • GMC Member
  • 7 posts

Posted 03 October 2010 - 08:14 AM

how do i change the car to another car? :whistle:
  • 0

#28 ash47

ash47

    O_o

  • GMC Member
  • 1326 posts

Posted 18 November 2010 - 03:16 PM

I basically got a black screen, and that's all (and one core was being fully used by the game), i will leave it for a little longer but i dont think anything is gonna happen...
  • 1

#29 Commentator

Commentator

    GMC Member

  • GMC Member
  • 7 posts

Posted 12 March 2011 - 07:07 AM

if your car always fly.
the car will fly if your game fps drops low
then try
movement_scaling = 1;
instead of
if (fps > 0)
    movement_scaling = 30/fps;
else
    movement_scaling = 1;

  • 0

#30 aburgin

aburgin

    GMC Member

  • New Member
  • 46 posts
  • Version:GM8

Posted 17 March 2011 - 06:13 PM

I tried something that seems to work. I based it upon the comments by Tepi above.

in obj_car, in the step command

change the first if statement to

//////////////////////////////////
if (fps > 1)
movement_scaling = fps/30.0;
else
movement_scaling = .7;
//////////////////////////////////

I tried movement scaling = 1 and the first time I ran it, the car flew away. The GMK does seem to work with that change
(BASICALLY INVERT THE "30/FPS" TO "fps/30" I changed the conditions to keep movement scaling away from "0"

There is still a little choppiness with the camera. The slew rate of the camera needs to be slowed down a bit (or just not tied to the car velocity) what might work would be to add some hysterisis to the math

Oh yeah ... on the one street that is angled, the car tends to disappear below the pavement.
  • 0

#31 aburgin

aburgin

    GMC Member

  • New Member
  • 46 posts
  • Version:GM8

Posted 17 March 2011 - 06:28 PM

I tried something that seems to work. I based it upon the comments by Tepi above.

in obj_car, in the step command

change the first if statement to

//////////////////////////////////
if (fps > 1)
movement_scaling = fps/30.0;
else
movement_scaling = .7;
//////////////////////////////////

I tried movement scaling = 1 and the first time I ran it, the car flew away. The GMK does seem to work with that change
(BASICALLY INVERT THE "30/FPS" TO "fps/30" I changed the conditions to keep movement scaling away from "0"

There is still a little choppiness with the camera. The slew rate of the camera needs to be slowed down a bit (or just not tied to the car velocity) what might work would be to add some hysterisis to the math

Oh yeah ... on the one street that is angled, the car tends to disappear below the pavement.

Update: well .... close but there is still some unstability .... if the car is left alone... it eventually rolls over(rotation needs bounding) and the camera points skyward..... dang


  • 0

#32 LiBeRtY

LiBeRtY

    GMC Member

  • New Member
  • 1 posts

Posted 18 March 2011 - 09:36 AM

a very successful study :)
  • 0

#33 theg721

theg721

    G Dawg

  • GMC Member
  • 1959 posts
  • Version:GM8

Posted 11 April 2011 - 12:21 PM

Looks good, I'll check it out later. Screenshot reminds me of GTA.
  • 0

#34 FantiX

FantiX

    GMC Member

  • GMC Member
  • 174 posts

Posted 11 April 2011 - 04:14 PM

I got a black screen as well.
had to end it the hard way.

not windows 7 compatible?
  • 0

#35 aburgin

aburgin

    GMC Member

  • New Member
  • 46 posts
  • Version:GM8

Posted 16 April 2011 - 10:18 PM

Greetings !

It was a rainy day today. I saw the great tutorial from Fede-Lasse on delta timing (located here) ... and thought ....hmmm....

-I adapted the original code to include the delta-time script.
-fixed all the textures to power of two
-modified the camera to include mouse_x into tx to add rotation to the view
-made obj_rod a fixed calculation ( this seems to be where the instability originates)
-modified the map of the city to include complete track (no more dead ends)
-added ground all the way around the track. The car was dissapearing below the pavement due to the ways it located the min z height. (yes, I could just modify the parameters of how far it loos for the terrain Z
-fixed the trees (no longer above ground)

yet to do - fix all the buildings in the way they calculate where the floor should be (right now zmin = 0)

Hopefully this works for you with minimum glitches. The car initially appears below the pavement and bounces up. It has to be due to the initial state of z being zero and

You may have to play with the mouse to get the view back on the car. I didn't zero out the mouse first yet (TBD)

Take a look at

Download gmroadtile.zip from Host-A

JMike (The author) did a lot of really good work here.

Well ... that's as far as I got today !

Edited by aburgin, 16 April 2011 - 10:19 PM.

  • 0

#36 AquaFerno

AquaFerno

    GMC Member

  • GMC Member
  • 6 posts
  • Version:GM:Studio

Posted 10 April 2012 - 03:20 AM

However: you gonna credit the guy who made those road textures? Lul, I can tell you print screened the box of a guy's item for sale in Second Life.


As noted in the first post the textures are available for download on sketchup 3d warehouse. I don't know who originally made them or what the license agreement is to use sketchup models and textures in games and third party products. I assume that if the 3d warehouse is open for downloading models, they are meant to be used. You can find the textures here:

http://sketchup.goog...mp;prevstart=36

I'm stiff confused though - as to how I add hills to to road.


The hills (or terrain if you will) are created by a couple of sin functions multiplied together, and capped at the ground level. Look in the create_tiles() script.

Hope this helps!



How would I add heightmaps instead of using sine functions to generate the terrain? In the description, you mentioned that it is indeed possible to use heightmaps. I know it's relatively easy (with ds_grids to store the data from the z values of each point on the terrain), but I am a bit confused :wacko: and can't see how I would add them. I want to use a 128X128 heightmap with cell sizes of 256X256 (like the tiles in the example) to create the terrain and draw the tiles on to that. Could someone point me in the correct direction for this? :confused:
  • 0

#37 Futhark

Futhark

  • GMC Member
  • 682 posts
  • Version:GM8.1

Posted 10 April 2012 - 04:09 AM

I also do get a black screen(which sometimes becomes white) and just a hanging hourglass.
Am running Win7 on an Acer Aspire 5532, AMD Athlon 64, 1.6GHz, ATI Radeon HD3200, 3GB RAM.


...
Download gmroadtile.zip from Host-A
...


Was hoping this ^^^ would be a better bet but alas, the file has gone 404 :-(
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users