Web
Analytics
Log In  

18

Cart [#51644#] | Copy | Code | 2018-04-15 | Link
18

Here's a landscape / flight simulation engine that I have been playing with. I'm still figuring out how to turn this into a game, but at least it's functional now and runs at 30 fps.

It takes a few seconds to generate the map using simplex noise mapped onto a sphere.

Controls:
Arrow keys to turn and pitch up and down.
Z-key to accelerate

Notes:
There's a 3D shaded polygon engine built into this as well, but I'm not using it yet.

Thanks Anthony DiGirolamo for the simplex noise:
--https://www.lexaloffle.com/bbs/?pid=32443

--ElectricGryphon

3d flight terrain
P#51645 2018-04-15 17:32 ( Edited 2018-06-22 16:52)

::

Wow that's impressive, well done :)

P#51649 2018-04-15 18:40

::

So smooth!

P#51654 2018-04-15 20:59

::

This is my new favourite thing.
Now if you could squeeze that old voxel helicopter game Comanche in there, that would be great :D

EDIT: Fixed link :D

P#51672 2018-04-16 04:32 ( Edited 2018-04-16 06:58)

::

Your link is broken arashi, trying formatting it differently.
Boop

P#51674 2018-04-16 04:56 ( Edited 2018-04-16 04:56)

::

Wow, well done. Something reminds me of the old Virus game on Amiga. Probably not really like it, just reminds me.

P#51675 2018-04-16 05:13

::

Excellent! Magic Carpet! :D

P#51676 2018-04-16 05:43

::

Magic Carpet +1

P#51677 2018-04-16 06:17

::

Very cool

P#51680 2018-04-16 07:30

::

Wow, that's amazing stuff as always electricgryphon! :D

P#51681 2018-04-16 08:24

::

FLOORED, that looks so good!
Another Magic Carpet vote if you feel like it.

P#51685 2018-04-16 09:51

::

What about the CPU? Do you still have some power left?

P#51709 2018-04-17 04:35

::

Or it could be a black&white simple clone

P#51710 2018-04-17 04:38

::

I'm at about 91% CPU right now. But if I can't squeeze more out of the engine, I can always shave a 5-10 pixels off of the left and right, change the clipping or draw distance. I think there's room before things get too chunky and noticeably degraded.

Tokens 5676/8192
Chars 33154/65535
Compressed: 13472/15360

I don't think a simplified/demake magic carpet is out of the question.

P#51725 2018-04-17 10:33

::

@electricgryphon

I was looking through your code (you're shocked, I know) and saw this, and I'm wondering why you've got these extra parens in here:

function rotate_point(x,y,z)    
    return (x)*mat00+(y)*mat10+(z)*mat20,(x)*mat01+(y)*mat11+(z)*mat21,(x)*mat02+(y)*mat12+(z)*mat22
end

Is this maybe copypasta from a C/C++ macro or something? I can't think of any other reason to have parens around the params like that.

I can't remember if parens incur a cycle cost, but they definitely add a token for each pair.

P#51729 2018-04-17 12:44

::

Ha good question-- yeah probably from a copypasta experience--perhaps I had a + offset in the parens or something at one time. If it gets tight for space, I'll definitely have to do some scrubbing.

Let me know if you see any other opportunities.

P#51732 2018-04-17 14:17

::

Mightily impressive as usual... Speed is perhaps a bit high for the size of the map (it seems to take only a couple of seconds to traverse).

P#51744 2018-04-18 02:27

::

@electricgryphon

FYI--

I was curious how well it could perform, so I diddled this and that and got it down from 0.9 to about 0.75. I didn't do anything amazing, just looked for loop invariants in the inner loop and a couple of places where I could put globals in locals to shave off cycles, pico-8-specific tricks, that sort of thing.

(I did this because optimizing is something I do for fun.)

I don't think you'd want to work on it in this optimized state, though, as it became less flexible and tweakable, but I wanted you to know you could potentially get this extra 15-20% speed if you need it down the road. I'm sure you're capable of it yourself, so I won't bother telling you what to do. :) Just thought you'd like to know the headroom is there.

(I will say that the main speedup came from putting more of the color/brightness calcs inside of the 'if' where you decide whether or not the existing height of the current column exceeds the height of what you're about to draw.)

P#51755 2018-04-18 10:27 ( Edited 2018-04-18 10:32)

::

This is so beautiful and relaxing; I'd love to play this while listening to some vaporwave haha

P#53692 2018-06-22 00:08 ( Edited 2018-06-22 00:08)

::

WOW!!! So many things to get excited about and learn from!!

P#53706 2018-06-22 16:52

Log in to post a comment

user:
password:

New User | Account Help
:: New User
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-10-20 21:14 | 0.262s | 1835k | Q:36