[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Horizontal infinite "hill" terrain strategy

Horizontal infinite "hill" terrain strategy

Official forum for the .

Horizontal infinite "hill" terrain strategy

Postby barnaclau » Mon May 21, 2012 9:03 pm

Hi all, I'm looking for the best strategy for horizontal infinite terrain scrolling. I have found that DeformableChipmunk (DeformableDemo) seems to be the closest to what I need.

Now, what I'm trying to achieve is something similar to a wave or hill (think TinyWings). But the implementation in that demo is confusing me quite a bit. Is it possible to do your own custom function to generate the segment positions of a continuous line? If so, how would you do you do that?

I couldn't find any other pointer on how this could be achieved online, so I'm giving this forum a try.

Thank you,
Claudia Barnal
barnaclau
 
Posts: 11
Joined: Wed Mar 28, 2012 10:21 am

Re: Horizontal infinite "hill" terrain strategy

Postby slembcke » Mon May 21, 2012 9:19 pm

So I want to make a Chipmunk Pro example to show how to do a racing game like that, but haven't gotten to it yet. I wrote one a few years back using Ruby though called ByteRacer: http://howlingmoonsoftware.com/extras.php

If you open up the app bundle, you can see the Ruby code for it. It uses the Ruby version of the Chipmunk Object protocol, so it should be pretty easy to port to Chipmunk Pro. It doesn't use any autogeometry stuff (ByteRacer predates it), but for simple hills you don't really need or want it anyway. Just a couple nice octaves of 1D perlin noise added together.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Horizontal infinite "hill" terrain strategy

Postby barnaclau » Mon May 21, 2012 10:15 pm

Thanks, Scott! I'll check your Ruby app.

Just out of curiosity. Do you have an ETA for that ChipmunkPro example?

Thanks.
barnaclau
 
Posts: 11
Joined: Wed Mar 28, 2012 10:21 am

Re: Horizontal infinite "hill" terrain strategy

Postby barnaclau » Wed May 23, 2012 8:47 pm

barnaclau
 
Posts: 11
Joined: Wed Mar 28, 2012 10:21 am

Re: Horizontal infinite "hill" terrain strategy

Postby slembcke » Thu May 24, 2012 8:03 am

So pre-6.0 Chipmunk only supported spatial hashing for a spatial index. Chipmunk 6 now supports generic spatial indexing and the function was renamed to cpSpaceReindexStatic(), but does the same thing. The Objective-Chipmunk method is reindexStatic.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Horizontal infinite "hill" terrain strategy

Postby barnaclau » Sat May 26, 2012 8:49 am

That did the trick!

Now, I have this working, where the buggy moves to one edge and snaps back to the origin with the terrain being shifted properly when it reaches the edge. I'm now going to try to get terrain to move around the buggy instead.

I'm guessing you achieved this at a render level, transposing the x position of the rendering. Or did you achieve this somehow at a terrain logic level? I couldn't find any indication of the latter.

Thanks Scott!
barnaclau
 
Posts: 11
Joined: Wed Mar 28, 2012 10:21 am

Re: Horizontal infinite "hill" terrain strategy

Postby slembcke » Mon May 28, 2012 9:43 pm

Yeah, it's all performed as part of the rendering. I'd have to look at how the code worked again, but the car just always stays centered on the screen so you can't tell that it's all faked.

The reason I did that is because I wanted to experiment with keeping the player at the center of an infinite world to avoid possible floating point precision issues. I had no reason to believe that there would be precision issues at any reasonable value, but it seemed like a fun thing to try. You probably don't need it.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Horizontal infinite "hill" terrain strategy

Postby Nexus2911 » Tue May 29, 2012 7:36 pm

@barnaclau

I see per your last post you've gotten infinite terrain to work. Are you willing to share your code?

It would be greatly appreciated. Thanks!
Nexus2911
 
Posts: 65
Joined: Wed Feb 15, 2012 12:28 am


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 0 guests

cron