Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Ski simulator - or something similar

Author
Message
dn5
15
Years of Service
User Offline
Joined: 23rd Dec 2010
Location:
Posted: 10th Jan 2011 16:56
Hello guys, didn't post for long time here, I'm quite busy with design BMW preview, finding a job as 3D mechanical engineering right now at Bosnia BMW center.

Anyway, I got some questions for you guys, and I'm searching for answer, I overall know what I need to do but there are some problems.
The game I want to make is Ski simulator, something like:


Here is the basics of what I want to make:
* Create image sprites

Not same but just to see what I want to make
* Create map images
* Locate sprites on screen and make sprite collision


Problems:
* Hard to work with sprites, I don't see any example
* PHYSIC - which is hard to find/ or make
* Collision example

In game menu will be done in Delphi, as I'm pretty good coder (around year and so) in it + lot of components.
Thanks guys, just see my problems and try to 'get me into water' to see what I need to do.

By the way: The game was made by University of British Columbia, the computer science section.

Thanks!

[Its just me - and my opinion]
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 10th Jan 2011 20:15
If you're okay with spending some money, then I think the easiest option is to buy Box2D from the TGC website.

If not, then you'll be up to a lot of work. I think I have a general idea of how I would do it though. Maybe I could help.

Cheers!
Sven B

Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 10th Jan 2011 22:34 Edited at: 10th Jan 2011 22:37
Yeah, creating a 2d physics engine like this wouldn't be too hard, but it definitely would be hard if you don't have enough knowledge of DBPro.

Uhh generally, when you're building a 2d level, the collision data is totally separate from the pixel data. Say you had a picture that looked like those mountains - no background. The pixel representation of that has jagged edges, it's just an approximation! As such, it's hard to make sense of what's touching what.

If I had to make a physics engine like this, here's what I would do:

(1) have a distinction between *attached* and *detached* from the ground. Attached=sliding, detached=in the air
(2) Work out a point sliding along a line, with any slope, and any starting velocity (including gravity)
(3) extend this to line segments - fall off when you get to one end
(4) work out sliding from one line segment to another
(5) load information from a text file (or something) of line segments, creating a slope

Then the main backing would be done, and you would just have to handle putting a background on it.

Still, doing that would be lower quality than using box2d. Creating an accurate/quality physics engine requires a lot of math and optimization stuff :\

Uhh a knowledge of 2d math wouldn't hurt either - rotations, vector math, and the like. You might already know it but I thought I'd mention it. (for example, say your person is resting on a line given by <x1,y1> <x2,y2>, what angle do you give him so that his board is resting on the surface, and he is pointing upwards?)

[edit]
where you'd run into trouble with making your own physics engine would be the rotating player - nose grinds? tail grinds? Hitting his head on the ground? OFC with physics knowledge that might not be too hard to do... but I'm not too sure :S

dn5
15
Years of Service
User Offline
Joined: 23rd Dec 2010
Location:
Posted: 11th Jan 2011 14:08
Neuro Fuzzy, that was nice info, thanks. I thought I could do that by using colors. You know the transparency trick? When you have Black box and around it the pink color which represent the transparency mask. Thats what I think, but that won't go, I already try it.


No comment that answers me everything.

My two founds are this:

and this really good link which explain me 2D math of ski phy:


So my only opinion would be Box2D, right?
Thanks, I appreciate your answers!

[Its just me - and my opinion]
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 11th Jan 2011 22:43 Edited at: 11th Jan 2011 22:46
:S I dunno, you really don't need to go that in depth with the physics! The player might as well be snowboarding on sandpaper. Besides, those equations mostly deal with 3d situations, where you can move left and right. Anyways, you aren't going to learn much without trying to code it. I would suggest trying to do this:

Quote: "(2) Work out a point sliding along a line, with any slope, and any starting velocity (including gravity)"


Meaning, you have a point on a line - if it's flat, the point doesn't move at all, if it's tilted up, the point falls down. It's useful to have a bunch of different equations for lines:
y=mx+b
y-y1=m(x-x1)

or, my favorite, parametric lines for t from 0 to 1
x=(x2-x1)*t+x1
y=(y2-y1)*t+y1 (when t=0, (x,y)=(x1,y1). When t=1, (x,y)=(x2,y2).)

A link you should check out would be this if you don't already know the information:
http://www.physicsforums.com/showthread.php?t=357378
It's just a block sliding down an inclined slope, including friction. Whether you want to worry about friction or not is totally up to you.


[edit]

also, How much are you familiar with DBPro coding? If I asked you to make an User Defined Type (UDT) array with nothing in it, add 20 elements, and then remove 5, could you do it? If not, you probably want to check out some tutorials (there are some at the top of this board, and in the DBC board there are a ton of great tutorials, *most* of which also work in DBPro)

BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 13th Jan 2011 06:53
I agree with Sven B - buy Box2D from the TGC website.

This will let you spend most of your time making a great playable game,
and not all your time building a physics engine for your game that still won't be as good as Box2D.

For me, it is money WELL spent.
dn5
15
Years of Service
User Offline
Joined: 23rd Dec 2010
Location:
Posted: 13th Jan 2011 15:33
Neuro, you said if there is line that is flat, of course there is no movement, but if line is tilted down, and then straight it will still have some movement until it loses all capacity of movement to zero, I hope you understand what I mean. But of course you
seems better then my in physic. And about coding in DBPro, I'm not much experienced but I code in it for month or so. Note, I am Basic coder, Visual Basic for 4 years and I know from years ago QBasic.
I could code UDT with array, with nothing in it, but I couldn't add 20 elements if I didn't already declare it, so I would probably first need to set every array what is what and then change their strings like:

And then change their space. And no, I couldn't remove 5, probably I could do it in Delphi, but no in DBPro.

Thanks In advices.
Btw. Everyone talks about Box2D so I will must check that.

[Its just me - and my opinion]

Login to post a reply

Server time is: 2026-07-21 15:13:57
Your offset time is: 2026-07-21 15:13:57