Live data from Hacker News

Show HN: A PSX/DOS style 3D game written in Rust with a custom software renderer

totenarctanz.itch.io

31–37 of 37 posts

Re: Show HN: A PSX/DOS style 3D game written in Rust with a custom software renderer

#31
post #23

Earlier quoted context omitted.

You mean implicitly? I am aware that idiomatic Rust strongly prefers iterators over indices for performance, but in my case, the only place where it really matters is when counting pixels to draw, and there is no kind of collection there, just x,y numbers.

Yep implicitly, for receives an IntoIterator, so it iterates either on an iterator like 0..10 or something that can be converted into an iterator like &myvec (Note that it was a severe design flaw to make ranges like 0..10 iterators directly rather than just IntoIterator, because this means ranges can't be Copy and as such it's inconvenient to pass them around.. but fortunately they are going to fix that in a new edi…

Interesting, I will look more into this.

To be honest, grepping the source, I found a couple of places with for x in &myvec. Probably tried them while learning the language, they worked and left them there.

But really, I am just more used to the old way. It visually feels more familiar, I have an explicit i to do things, and it's easier to delete/manipulate elements while in the loop and not invalidate anything. It's not that I am against an iterator if it matters and it's better, of course.

In my case, the important loops are like "for i in x0..x1 { draw(i, y); }". Is there a way to turn this into something that, for example, skips the bound checks or optimizes it in any other way?

Re: Show HN: A PSX/DOS style 3D game written in Rust with a custom software renderer

#32
post #26

> I do my own physics, quaternion/matrix/vector math, TGA and OBJ loading. > FPS ranges from […] [70-80] on a 2005 Pentium laptop > I am using [Rust] more as a "C Great minds think alike! Please, I invite you to submit your work for approval here: https://xcancel.com/tsoding/status/1960511663788188095 https://xcancel.com/tsoding/status/1964636951358894337

Nice discussions! I've seen many of these projects lately around related communities. Happy to see a trend around this, as I really think there is actual merit in the topic. My project was more of a random timesink than something that pushes the matter forward though.

Do you mean directly e-mail/contact said person?

Re: Show HN: A PSX/DOS style 3D game written in Rust with a custom software renderer

#33
post #30
post #28

nice, but i find it very hard to play. acceleration is either not enough and you are pulled in by the planet, or it is to much and you are getting away so fast that you can't counter steer. shouldn't gravity take care of that? if i am in orbit, then speeding up along my trajectory should slowly increase the orbit, and slowing down should decrease it. but speeding up takes me immediately out of the orbit as if the pla…

Thanks for trying it out. It's a regular inverse square law, no tricks. The numbers (masses, distance) determine the final acceleration but not the actual trend of the curve. I've become too familiar with it over testing to notice unintuitive behaviour, but I think I understand what feels off: in real world units, the gradual region you describe is very wide, and feels linear. This would make for very boring gameplay…

maybe some kind of indicator to show which level of acceleration/speed is best would help.

the unintuitive behavior is that it is very difficult to find that balance. if i am to slow i crash into the planet, if i am to fast i leave orbit with no chance to get back in time. being gentle always results in being to slow. in other words there is no gentle way to reach the balance. and if i don't know where that balance is, i don't know what to aim for.

you may argue that finding that balance is the goal of the game, but then i guess the game is not for me. i lose interest if i have to try 10 times and still can't figure out how to do it right.

Re: Show HN: A PSX/DOS style 3D game written in Rust with a custom software renderer

#34
post #32
post #26

> I do my own physics, quaternion/matrix/vector math, TGA and OBJ loading. > FPS ranges from […] [70-80] on a 2005 Pentium laptop > I am using [Rust] more as a "C Great minds think alike! Please, I invite you to submit your work for approval here: https://xcancel.com/tsoding/status/1960511663788188095 https://xcancel.com/tsoding/status/1964636951358894337

Nice discussions! I've seen many of these projects lately around related communities. Happy to see a trend around this, as I really think there is actual merit in the topic. My project was more of a random timesink than something that pushes the matter forward though. Do you mean directly e-mail/contact said person?

Tweet

Re: Show HN: A PSX/DOS style 3D game written in Rust with a custom software renderer

#35
post #33
post #30

Earlier quoted context omitted.

Thanks for trying it out. It's a regular inverse square law, no tricks. The numbers (masses, distance) determine the final acceleration but not the actual trend of the curve. I've become too familiar with it over testing to notice unintuitive behaviour, but I think I understand what feels off: in real world units, the gradual region you describe is very wide, and feels linear. This would make for very boring gameplay…

maybe some kind of indicator to show which level of acceleration/speed is best would help. the unintuitive behavior is that it is very difficult to find that balance. if i am to slow i crash into the planet, if i am to fast i leave orbit with no chance to get back in time. being gentle always results in being to slow. in other words there is no gentle way to reach the balance. and if i don't know where that balance i…

Understandable. That's kind of the goal, the gameplay is very shallow complexity-wise, so raw responses/difficulty is one way to put some playing time into it.

There are some methods that help a lot, like keeping a completely perpendicular or parallel viewing direction, and adjusting the distance with the corresponding set of thrusters. Even slight angles mean you have to randomly mash forward/backward/left/right and hope to keep a steady orbit, it's not gonna happen.

For what it's worth, even for me now, it would take more than 10 tries probably to beat Master on Mission 1.

Re: Show HN: A PSX/DOS style 3D game written in Rust with a custom software renderer

#37
post #36

If you embed all the assets in the binary, the download would be an instantly playable single file..!

It would be cool indeed, I played around with !include_str and co. and works as expected. It wouldn't be possible for the user to modify the assets though, and to save the settings file.
Post reply on HN