Jump to content

  • Log In with Google      Sign In   
  • Create Account


Selenaut

Member Since 15 Mar 2012
Offline Last Active Mar 18 2013 10:30 AM

Topics I've Started

Collision Physics Question

27 January 2013 - 11:17 AM

Hello again, all.

So I've kind of switched gears since my last game idea; this time, I'm thinking about a 2D platformer. I won't get into details, but I'm making the entire engine from scratch and I'm currently having some trouble writing an algorithm for one of the physics mechanics.

 

So suppose we have an object moving in a 2D plane that hits a static object (e.g. a wall) that is at an angle. Rather than bouncing, the object hits the wall and begins to slide down (or against, or whatever) the slope via deflection. If we know the velocity vector of the object before and the angle of the slope that it collides with, what is the resulting vector?

 

I have an idea that I can explain in words, but I can't seem to figure out how to program. What I've done on paper is put the object's incident vector's tip at the collision point on the slope. I then extend this vector past (underneath) the slope to find the hypotenuse of a right triangle. The legs are parallel and perpendicular to the face of the slope. the leg of the triangle that's parallel to the slope is obviously the resultant vector of the object, and it moves in that direction to slide down the slope.

 

The problem is: What is the formula for that?

 

I've already done bouncing off slopes, but this in comparison is much more complex of a problem. I want to use this to create fluid motion when the PC is sliding up and down slopes.

 

If you want to see my vector classes, I can post them, but at the moment, I'm just asking for help on the equation.

 

(Side note: Due to the way I'm planning to implement these slopes, I don't have to worry about ray casting or anything, as the game will be tile-based and each of the slope tiles will have angle variables that can be accessed when colliding with them.)

 

Thanks,

 

Selenaut


The Intriguing Problem with Map Wrapping

27 November 2012 - 09:25 PM

Hello all, I have been working on a program for quite a while involving randomly generating a "planet." This may sound like quite a challenging task, but the initial stuff needed, like generating a wrapped height map, was simple. What I did was generate a 2D array of wrapped Perlin noise, or some sort of variation on it.

Anyway, this is where the simplicity ceases, as the next step I wanted to make involved creating weather and climate. (Keep in mind, I'm attempting to keep this to a 2D map; think Dwarf Fortress.) I decided first to start with temperature: I planned on doing so by combining the altitude of the generated land with the latitude, and create a formula to calculate the temperature based on these two things.

Here's the problem: If I create a map on a two-dimensional plane that wraps around both vertically and horizontally, it is literally near impossible to figure out where the poles go.

My first idea was to delineate the top and bottom of the map as the poles. Problem is, this results in only one pole, as the map wraps and both ends meet.

My second idea was to have a second pole in the middle of the map. The problem with this scenario is that if I were to travel left directly from this pole all the way across the map, I would end up back at the same pole, without meeting the other pole as I should.

Now, I can't think of any way to possibly make this work without completely rethinking how the map generation works. So I delve into another idea: a randomly generated map in the style of a Mercator projection, a map design in which the world is laid out as though it were a cylinder.

But this also seems to be a trap, because if I were to keep generating to a rectangular map, it would be impossible to wrap if the player goes past the top or bottom borders of the map.

This may sound confusing, and if I have time later, I may include some pictures helping to illustrate my point. Until then, please feel free to help me solve the mystery of the Single-Pole Planet.

Thanks,

Selenaut

Roguelike Long-Term Project Idea -- Feedback Appreciated

15 March 2012 - 05:31 PM

Hello all,

I'm a new user here, but I'm not new to the forum. After thinking through my roguelike project idea for some time, I've finally decided to post it here. Any questions or comments would be appreciated.

OVERVIEW
My idea is to create a game in the style of a roguelike in which the player has a completely mutable and open world, where their actions leave effects long after they've (inevitably) died. It will include being able to start your own farm, build your own house, hunt wild animals and fight monsters, create relationships with individuals and civilizations, crafting and forging, and hopefully numerous other ideas that I haven't yet thought of.

However, I am striving to make the game realistic. What I mean by this is that the player will need to eat, drink, sleep, etc., and the actions performed by the player would be limited to realistic circumstances; so chopping that tree, instead of five seconds, may take upwards of 15 minutes (in-game). In addition, buildings and structures will be built brick-by-brick. This means that the player can build their own house from the bottom up, and that the materials required would be realistic (and that it could take Joe Smith a few in-game days to gather materials to build a small wooden hut).

WORLD GENERATION
The world will be procedurally generated based on numerous parameters. First, a height map is introduced. From this, a land-or-water map is created (basically just to help with later procedures). These two maps are then used to create many more maps for other parameters. The order of the generation of these maps is:
  • Height
  • Land-or-water
  • Coastal (used for temperature)
  • Temperature
  • Rivers & Lakes
  • Biomes
  • Precipitation
  • Plant factor
  • Animal factor
  • Danger factor
  • Civilization factor
  • Towns
  • Lairs
  • Roads
COMBAT AND MOVEMENT
I am thinking about using continuous time elapse as the basic action mechanic. What I mean is that it isn't turn based, so that even without giving any input, time will elapse in-game. However, during some actions such as talking or sleeping, time may slow down or speed up, respectively. So instead of being able to take your time, wondering which way would be the best to run away from the giant horde of alligators chasing you in the sewers, you have to run for it, and so thinking (and planning) ahead becomes a very important skill.

SKILLS & STATS
I am thinking about, instead of having overall levels and being able to increase stats as you choose, having the player's "strength" grow based on the skills that are being used. So for example, you would actually have to cut wood to increase your woodcutting ability (as well as your Strength and Constitution stats, perhaps?).

OTHER STUFF, NOTES, ETC.
Eventually I want to implement the other features that I mentioned in the overview, but I haven't thought about them enough to give them enough explanation here. So for now, that's about it.
Also, feedback would be greatly appreciated; at the moment, I'm looking to bounce ideas off of people and to see how well people react to it.
Finally, if you think this is too much of an undertaking, I stress that this is a LONG TERM project, as well as a hobby of mine.


Thanks for your time,
Selenaut

PARTNERS