This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Doing a better game engine - some thoughts on ice blocks

Doing a better game engine - some thoughts on ice blocks
by on (#57828)
Hey all. Well, I want to get back into it and do up a new game engine, but this time I want to have some more elements come into play.

The main thing I'm wondering about is some acceleration and deceleration when it comes to moving across various terrains. What I want to have would be your typical solid tile, but also ice blocks and sludge (water that's hard to move in).

For the ice, I wanted to try and copy the physics of it taking some time to get to speed while walking, but if you were to jump and land and be moving forward, you are already at speed. When you let go of the button, there'd be some deceleration as you slide forward. Again, jumping could cancel this. It seems like it'd just be having some var count to some number until it reaches a max, but the real trick would come if you turned around. On normal ground, you'd just be immediatley moving in the opposite direction with no deceleration happening. With ice, you'd slide, decelerate, then accelerate in the opposite direction. It seems like ice will need a few exceptions....

I don't know. Has anyone tried doing ice mechanics before and could tell me if I'm not seeing something that could be easier?

The sludge is another one that'll be fun, but we'll save that for later. 8)

by on (#57832)
I will just think out loud but I guess other people may say the same thing.

Instead of adding a velocity factor when I go right and removing when I go left, I would always add the velocity factor. The only difference is the velocity must be positive when going right and negative when going left.

When I would be on ice, if the player change direction (from right to left), instead of resetting the velocity to 0, I would add negative velocity to the current value. This way, even though the player would be facing left, he would still be moving right for a certain amount of time.

Maybe there is some easier way. Like I said, I'm just think out loud now. That was more fun to think about that then my current task at work at the moment (shhh... don't say anybody ;))

by on (#57833)
Having no acceleration is the only reason you can play Battle Kid with a keyboard.

by on (#57835)
 

by on (#57838)
Please keep on topic.

by on (#57840)

by on (#57844)
Don't worry, I was not targeting you specifically ;) It just he asked about how to program something and most message were not related to it. This is what I meant to stay on topic, which is to answer the question with the information that he's looking for.

by on (#57852)
Well I don't recommend anyone to answer his questions, because he'll sell products using your ideas and make money on our backs again. Just my personal recommendation tough.

by on (#57856)
^^Or you could help out your fellow man and stop acting like a pretentious person who can't actually complete a game of his own so takes it out on other people . (In other words if you don't have anything nice to say....don't post at all)

by on (#57858)
Jeroen wrote:
Or you could help out your fellow man and stop acting like a prentious person who can't actually complete a game of his own so takes it out on other people

I don't think Bregalad is talking out of frustration for not completing his game, as I seem to remember he has no intention of selling it (at least not exclusively).

To some extent I think he has a point, it's like a person gives me the recipe for some cookies and then I try to sell the cookies I made back to that person. It's not right.

The situation is not exactly like that though, because Sivak has to modify the recipes quite a lot before coming up with a product, and even though it's in a sort of mercenary kind of way he's still contributing to the homebrew scene. He's helping to expand a market we all (NES developers) hope to get a piece of eventually, so while we can't come up with our own games, at least Sivak is keeping the market warm.

I guess this is how I see it, so I don't think it's so bad that he's making money out of knowledge he gets for free (I'm still not a big fan of that, but it doesn't outrage me anymore).

by on (#57860)
Mmmmm if this gets out of hand we might need split. Let's try not to get things too heated. Stil first of all like you said A.) Sivak has to "modify" the recipe alot. The knowledge is only a very very small part of the whole deal. It's like learning someone how to cook (use pans that kind of stuff) and then bitch if he sells cookies. B.) He HAS released games he discontinued in the past. C.) the fact that no one bitched about the same issues when bunnyboy released "glider" makes me think the only reason people are angry about this is the fact that they just wanted to play battlekid....for free.

by on (#57861)
Coming from the old school PC gamedev side of things, free info is for whatever use someone can make of it.

For ice, it's been done a number of ways. The usual NES approach has been something like what you described, where jumping could kill your forward momentum, landing while moving would keep you going with an exceedingly low deceleration, and manual acceleration (walking/running) was cat down by a hefty amount from usual amount.

Basically, for your usual platformer, the set of variables in play:

Current velocity
Max velocity
Ice walk/run acceleration
Normal walk/run acceleration
Normal decel
Ice decel
Jump walk/run acceleration

Accel affects current velocity depending on direction and ground/ice/air status.
Velocity is capped at +/- max
Net accel = cur accel +/- decel, depending on directions, etc

by on (#57865)

by on (#57866)
Jeroen wrote:
Mmmmm if this gets out of hand we might need split. Let's try not to get things too heated.

I agree to not getting things too heated, but even then I believe a split is in order.

Quote:
Stil first of all like you said A.) Sivak has to "modify" the recipe alot. The knowledge is only a very very small part of the whole deal.

Sure, I'm not taking credit away from Sivak by any means. Having started out asking questions here (and at the mailing list before that) myself I know that whatever is said here is by no means ready to be put in a game, all of it are just ideas that have to be worked on.

Quote:
It's like learning someone how to cook (use pans that kind of stuff) and then bitch if he sells cookies.

It's still bad if you try to sell something to someone who gave you something for free, even if the two somethings are not directly related, because it shows a lack of gratitude (you are not being as kind to the person who helped as he/she was to you). I don't know how Sivak would get around that though, it's not like he can go through the threads looking for the people who helped him and giving them ROMs.

Quote:
B.) He HAS released games he discontinued in the past.

This is a good thing. Although I don't remember him ever announcing such releases here, there are many more posts about the commercially active ones. Please correct me if there are such posts and it's just me that can't remember.

Quote:
C.) the fact that no one bitched about the same issues when bunnyboy released "glider" makes me think the only reason people are angry about this is the fact that they just wanted to play battlekid....for free.

I don't know if I speak for everyone here, but IMO opinion Battle Kid is the first game in a long time to show some evolution in the level of homebrew complexity, so it's only natural that it gathers more attention than the old and overdone minigame/puzzle games.

We still have a long way to go, after all Battle Kid is still a single screen at a time game, it only happens to have a LOT of screens. =)

But yeah, I'm still not sure what to think about this whole issue. Sivak's contributions to the community are indirect. He's helping to keep the general interest in homebrew alive, but he isn't showing much gratitude to his fellow developers who helped him get to where he's now.

Like I said, this is a difficult issue. I think it's hard to say what is right or wrong here, because of the weird way the retro scene works. We're used to getting things for free, as all those awesome games from the 80's and 90's are just one click away. But when it comes to new content, it's hard for experienced people to find the time to make games, so it's only natural that they seek for a form of compensation.

I for example have had so much work the last few weeks that I couldn't touch my personal projects at all. But I have to make money in order to live, so I'll either work on other stuff and have no time for homebrewing or I'll charge for my games. That is, I must charge for my time, so if people want games from me they'll have to pay for that time, or there will be no games. It's complicated.

by on (#57867)
http://nintendoage.com/forum/messagevie ... adid=30325 Here's sivak talking about releasing his games. (there's a few other threads where he's done it in the past)

by on (#57868)
Robert wrote:
I'm a guitar teacher. If I gave someone a free lesson on the basics of guitar and s/he went on to produce a CD and made money, I'd have no problem with that.

The problem is not making money with something learnt for free, it's making money from the person who taught for free. In the case of your student, it would be a nice sign of gratitude if he gave you, his teacher, a free copy of the CD. Or at least send you a couple of MP3s so that you could enjoy what he's done with what you gave him without having to pay.

by on (#57869)
Well yeah but like someone (I think you) said...It's kinda hard for sivak to go back and find everyone who helped him.

by on (#57870)
Jeroen wrote:
It's kinda hard for sivak to go back and find everyone who helped him.

...and find a way to show gratitude towards them. Giving a ROM is not such a good idea because he can't be sure they will not go behind his back and release it to the public.

Maybe give them a nice discount (a lot more than $3) on the cart if they want to buy it? Like, give up the profit for these particular copies.

by on (#57875)
I don't know how well this would work, let alone if it would, but avoiding subpixels and going strictly with counters, one could have a set count down before moving in a particular direction, then, when the person stops, this same delay can be repeated, unless the person jumps or walks against the counter. The jump would reset the delay to 0, unless the fall makes contact with the ice, and moving in the opposite direction would simply make the delay counter expire faster.

To accomodate for small movements in opposite direction (when lining up a jump or simply to stop) the delay would need to check for a direction change and null if the full delay isn't met when going the opposite direction(this could open up a possibility for quicksand that doesn't allow movement unless the delay is longer, then the influence on movement could be reduced, etc).

Please ask if something confuses you, I get that a lot.

by on (#57876)
ReaperSMS wrote:
Coming from the old school PC gamedev side of things, free info is for whatever use someone can make of it.

+1. Sharing the info should be an unselfish act. If it bothers you that some people will not say "thank you" maybe it's better to not post at all.

by on (#57878)
Well I don't know but it seems sivak only comes to this board either to advertise his products or to ask for hep, which is what bothers me. He never helps other NES-devers like pretty much everyone else here does.

Anyway it's just my opinion - if you guys have no problem with spending time to help him only to have him exploit your idea to make him money it's not my problem.

And again it's not like if developing a video games was a hard tedious work or anything. For me it's just a fun hobby and if I have no times to do it I don't do it (that's why I don't make much progress). I don't think anyone will ever be able to feed his family by programing NES games again, Neil Baldwin is the only one here would knowns what this is, anyone else mentioning it will just make me laugh.

by on (#57880)
thefox wrote:
ReaperSMS wrote:
Coming from the old school PC gamedev side of things, free info is for whatever use someone can make of it.

+1. Sharing the info should be an unselfish act. If it bothers you that some people will not say "thank you" maybe it's better to not post at all.


Agreed.

by on (#57883)
Bregalad wrote:
Well I don't know but it seems sivak only comes to this board either to advertise his products or to ask for hep, which is what bothers me. He never helps other NES-devers like pretty much everyone else here does.

At the very least, he's shown that someone can learn NES programming, make decent games, and publish them in cartridge format. That should be inspiring to many. I'm not wild on the closed nature of it, but hell, show me others here who are open about everything and have been able to pull off publishing. For all I know, the two don't really go together, for whatever reason. Until we have tens of people here like that, I don't think it's a problem. I think it's useful to have a spectrum of developer types.

by on (#57885)
Bregalad wrote:
Anyway it's just my opinion - if you guys have no problem with spending time to help him only to have him exploit your idea to make him money it's not my problem.


You should probably stop posting publicly. Not sure if you realize this but ANYONE can read ALL of the information here, and use it for ANY REASON they want. Even if you ask posters if they plan on profiting first (which you don't) someone else could come along later and steal your brilliant ideas.

Say tokumaru asks that exact same question, looking for advice. You help him because you think he won't make money. Then someone else a year later reads the thread and makes a game using your idea. If that game is never released was your time wasted? What happens when the game is given out free but you aren't thanked? If that game is sold are you then suddenly being ripped off? You have lost absolutely nothing in all cases, but somehow money changes how you feel even though you have no plans to capitalize on it.

It's just your hobby, so you spend a couple minutes answering a question. No code, just a quick idea like acceleration. Then Sivak takes that idea and works for many months to make a game. How is that exploiting you?

by on (#57888)
No need to fight over this, guys. Fortunately we live in a world that's free enough for both of them to exist: this place is open to everyone, so Sivak can ask whatever he wants regardless of his intentions, and nobody is forced to answer, so Bragalad can abstain from helping. No need to fight.

by on (#57901)
tokumaru wrote:
Jeroen wrote:
Mmmmm if this gets out of hand we might need split. Let's try not to get things too heated.

I agree to not getting things too heated, but even then I believe a split is in order.

It's kind of hard to split when individual posts mention both the on topic and the off topic.

tokumaru wrote:
Giving a ROM is not such a good idea because he can't be sure they will not go behind his back and release it to the public.

Then watermark that shit. Ideally, with games being distributed on EPROM or flash instead of mask ROMs, it should be possible to make each copy traceable.

Bregalad wrote:
Well I don't know but it seems sivak only comes to this board either to advertise his products or to ask for hep, which is what bothers me. He never helps other NES-devers like pretty much everyone else here does.

This board shows only part of the part of the scene that Sivak inhabits. The rest is NA and #nesdev.

by on (#57971)
As others have said, ice and sludge rqeuire a more complex physics system. ReaperSMS pretty much got it.

Every frame, you add velocity (which may be negative) to the player's x and y values. Also, every frame you add acceleration (which may be negative) to the player's velocity values. Acceleration needs to be a force that acts to move the player downwards (y axis gravity) and a force that varies based on current velocity to slowly stop the player's movement (x axis friction). Jumping temporarily sets y velocity to a high number which will slowly be decremented by gravity. Moving left or right modifies x acceleration and counteracts friction (or ignores it altogether).

You have a different maximum velocity based on how quickly you want the player to move, so while on the ground and in sludge this value would change. You have a different acceleration based on how quickly you want the player to speed up to that maximum velocity, so while on the ground and on ice this value would be very small. When no direction is being pressed, friction would also be low as well (meaning the rate that velocity is moved towards 0).

As for the other topic in this thread...I hate talking about people as if they weren't there. I hope the discussion doesn't bother you too much Sivak. These forums are a free source of information and I'm really glad for that, that any of us can use the information we find however we want. Personally I'd really love to know more about how your games are put together, I asked before and didn't get a lot of info. But I understand that people can be busy or not forthcoming for various reasons, sometimes it's hard to explain how you did things. Some short blog entries or a developer diary of some sort would be of great interest to me, if you'd be willing.

by on (#58002)
Bregalad wrote:
Well I don't recommend anyone to answer his questions, because he'll sell products using your ideas and make money on our backs again. Just my personal recommendation tough.


Well, you really can't write working NES software without the info on this forum, so...

by on (#58006)
strat wrote:
Well, you really can't write working NES software without the info on this forum, so...

In that case, the wiki is incomplete. What info from the forum does one still need?

by on (#58008)
tepples wrote:
In that case, the wiki is incomplete. What info from the forum does one still need?

It sure is. One of these days when I have more time I'll take a good look at the wiki and see if I can come up with a list of things I think it's missing.

by on (#58014)
tokumaru wrote:
tepples wrote:
In that case, the wiki is incomplete. What info from the forum does one still need?

It sure is. One of these days when I have more time I'll take a good look at the wiki and see if I can come up with a list of things I think it's missing.
In comparison to the forums? Friendly, easy to read and understand instructions and sample methods. How to get started on a platforming engine or puzzle engine.

by on (#58021)
UncleSporky wrote:
tokumaru wrote:
tepples wrote:
In that case, the wiki is incomplete. What info from the forum does one still need?

It sure is. One of these days when I have more time I'll take a good look at the wiki and see if I can come up with a list of things I think it's missing.
In comparison to the forums? Friendly, easy to read and understand instructions and sample methods. How to get started on a platforming engine or puzzle engine.

Yeah I think the main thing missing is the more "practical" (as opposed to technical) stuff, like map scrolling, collision checking, physics, sprite engines etc.

by on (#58043)
tepples wrote:
strat wrote:
Well, you really can't write working NES software without the info on this forum, so...

In that case, the wiki is incomplete. What info from the forum does one still need?


I'm just starting, so perhaps my perspective could be of use.

I might have missed this on the wiki, but I didn't know about the different ways to structure my code around NMIs. For example this thread, (or later on in it, at least), helped me out.

Also, more recently, this other thread has helped me with level layout and compression; however I'm still a little shaky on the subject.