Feel like giving my game a test?

Well I finally got my game to a state where I feel it can be shown to others, though it is a long way off being anywhere near completion. The reason I’m showing it now is because I want to know:

  • Does it run smoothly (Frames per second)
  • How does the ship motion ‘feel’?
  • Does the keymapper work?

It’s engine-only, so to play it you’ll have to head to this link:

Link removed as it has expired

By default the controls are:

  • Mouse
  • WASD
  • R/F for strafe up/down
  • X for ‘emergency thrust’
    But you can change them via the ‘edit controls’ link.

There isn’t anything shooting at you yet, nor can you shoot at anything either, but you can fly around.
Screenshot:


If you think it looks like Descent (1995), you’d be about right. It is heavily based on descent, though it intends to be simpler. Even the simplistic colors/lack of detail in the cockpit and test level is unlikely to change.

Here’s the player ship from outside, though you can’t see it in-game yet:

So the game is going to be multiplayer. Just 1v1 though, with the server hosting it keeping ranking players. Ideally other people will be able to observer currently playing games.
There is a huge amount of work to do before it gets to that though. (probably a year or so)

I can’t say I know any other playcanvas games that have customizable key config, so here’s a screenshot of it. It’s done in HTML+javascript, storing the config in a cookie for a year.


If anyone want details on how it’s done, feel free to ask (or just look at the HTML+javascript. It’s not minimized)

Hey, that’s lovely.

Rock solid 60fps on my Macbook Pro 13". I think you’ve got the inertia pretty good for the ship. It feels good flying it around. I immediately changed key config to use SHIFT for the emergency thrust, perhaps that’s a better default?

Looking through the code, nice and clean. Great work.

One thing I found interesting are your common functions:

function glob2loc(vec, entity){
    lvec = new pc.Vec3()
    lvec.x = vec.clone().dot(entity.right)
    lvec.y = vec.clone().dot(entity.forward)
    lvec.z = vec.clone().dot(entity.up)
    return lvec
}

function loc2glob(vec, entity){
    gvec = new pc.Vec3()
    gvec.add(entity.right.clone().scale(vec.x))
    gvec.add(entity.forward.clone().scale(vec.y))
    gvec.add(entity.up.clone().scale(vec.z))
    return gvec
}

First, interesting to see you need these makes me think they maybe should be somewhere in engine. If I’m right, these are converting world space “vec” into an entity’s local space and the reverse.

Second, each of those function is doing 4 allocations (new Vec3(), clone()). You should definitely try and avoid this as it will lead to unnecessary garbage collection. In glob2loc I don’t think you need any of the clones, as dot doesn’t modify the vector. In loc2glob you could use a tmp vector that is allocated once outside of the function.

I’d love to know more about your development pipeline? Are you modelling the levels in blender?

Rock solid 60fps on my Macbook Pro 13". I think you’ve got the inertia pretty good for the ship. It feels good flying it around.

Good to hear

I immediately changed key config to use SHIFT for the emergency thrust, perhaps that’s a better default?

I have issues with modifier keys when I’m developing on linux. Shift, control, alt, tab etc. don’t work as I’ve mentioned here. (Sorry, I have two accounts to confuse people…[I’ll stop using that account soon]) The keyconfig I’d normally suggest is:
WSAD = normal strafes
Space = strafe up
Shift = strafe down
Control = emergency thrust

One thing I found interesting are your common functions … snip… First, interesting to see you need these makes me think they maybe should be somewhere in engine. If I’m right, these are converting world space “vec” into an entity’s local space and the reverse.

I spend half-an-hour looking through the API for these functions before concluding they weren’t there! You are completely correct in figuring out what they do.

In glob2loc I don’t think you need any of the clones, as dot doesn’t modify the vector

Sounds reasonable. To be honest I changed as little as possible from loc2glob which I wrote first. Thanks for pointing this out.

In loc2glob you could use a tmp vector that is allocated once outside of the function.

I’m not sure I quite get how this would work. All the cloned vectors are different. I guess I could set the length so I don’t have to worry about previous scaling, but then it may mess up math using these vectors in other parts of the code.

If you notice any other weird things I’ve done, please point them out. I’m sure there’s some other stuff that made you go ‘why did he do it that way?’ Any criticism or advice is gratefully accepted.


I’d love to know more about your development pipeline? Are you modelling the levels in blender?

So would I…
Yup, I’m modeling them in blender. That particular level was exported to .fbx and converted using the online system. Future untextured levels can already be converted with my blender to playcanvas exporter. I need to figure out a little more of blender’s internal data structures before I can get exporting UV maps working properly. In a (hopefully) non-offensive way I’m trying to separate my games requirements from the playcanvas servers. This simply ensures that in a couple years, no matter what changes you’ve made to your formats/servers/engine, my game will still be able to have levels made for it. It also means that people who don’t have a playcanvas account can make levels for the game.

Runs great on my Windows laptop using Google Chrome.
I did change the X/Y velocity to 600/-400 which made controlling it much easier imo :smiley:

As mentioned by Dave, the X-truster might need some reconsidering, perhaps double tap the W-forward?

Roll took a little while to get used too, but I was flying that thing like a pro after 10 minutes :wink:

Overall, looking good, keep it up :wink:

did change the X/Y velocity to 600/-400

Uh, mind if I ask what variables you changed to do this?


Good to hear it’s working for others. I have a slightly updated version on my hard drive. No new functionality but a much nicer code layout.
I’m just about ready to start adding shooting. Models are built/textured/converted, and it’s awaiting code design+implementation.
Unfortunately work just keeps getting in the way.