Space Inc. - a HTML5 top down multiplayer space game
Space Inc. - a HTML5 top down multiplayer space game
http://websocket.bonsaiheld.org
Please read this first: The movement is very clunky at the moment. That is on purpose, so don't get confused, i'm working on it. I recently implemented time based animation on the server and am brainstorming how to get rid of these resets you see when you start moving or rotating. This is when the server corrects your coordinates and ship angle before it actually moves or rotates you. For now this makes the game pretty hard to play, but because of that it's more or less synchronous and that is a huge step forward as time based animation will soon enable many things which don't work yet (like dying). The problem is that the server, of course, moves you longer than you do locally because of your latency and this makes the game asynchronous. That's why i let the server always correct everything. I think i somehow have to work with time here to fix this crap and enable local smooth moving... *brain brain brain brain...
This is the HTML5 2D multiplayer space game i'm developing. It is my main project to learn how to program. So i'm a beginner and therefore many things don't work flawless yet (even the mouse controls are flawed). The game is built in Canvas with pure Javascript, no framework used. The websocket connection is powered by the Socket.IO library. Just come in with your browser, try it out, fly around and shoot enemies or players (if you're not the only one online).
The game will be a pulsating, persistent MMO world which continues to run even if no player is online. Also it is completely in german yet, but most things should be self-explaining. If not, just click around - you can't break much. :)
- Chat: Enter (duh)
- Movement: WASD or arrow keys
- Shooting: Left and right mouse buttons
- Info screens: R, (dot), (comma), SHIFT + P, SHIFT + S
- Station communication: C
- Main / configuration menu: ESC
- Background change: Q (just for testing purposes)
- Debug mode: P
- Real account system where you login (i consider a guest mode though)
- Guilds / clans (companies and corporations)
- Trade & inventory system: Collecting resources and items, buying and selling (you already can collect ores from asteroids)
- Missions: Predefined and random ones, to get items and other stuff
- Many upgrades and items for your ship (weapons, shields, stat upgrades, modules)
- More ships to buy or to get from missions: From small fighters and big trade ships to fregates (companies) up to huge destroyers (corporations)
- Friend system, private messages and mailbox
- Multiple sectors to travel to (only one yet)
- Universe populated and controlled by an AI (factions or something), running even when no player is online
- and other "i don't know yet if i want to do that"-stuff
Artwork from OGA i'm using: http://opengameart.org/content/artwork-used-by-space-inc
Note: The game is best viewed in Chrome/Chromium and Safari (all Systems) and Firefox on Windows. It mostly runs very slow in Firefox on GNU/Linux - you're lucky if not as that means your firefox has direct access to your graphics card. You can make the game run faster if you reduce the size of the window.
I would like your comments, especially about the core game mechanics: Flying around and shooting and later you can collect resources and items. Do you like that? It's a pretty basic concept, similar to Asteroids, but you control your weapons with your mouse to have full 360° control over your turrets independent of your ship. So, yeah... I'm not only developing this game to learn how to program but also because i basically just want to play a game like that myself. I am my own game's biggest fan! Isn't that the best motivation one can have? :D
My main inspiration comes from the X series from Egosoft, one of the most complex and most beautiful 3D space simulations existing. You will immediately recognize X when you check the galaxy or sector map (dot or comma button). If you don't know these games, think of EVE online.
There's alot (i mean, really alot) to do for me. You can't die yet and much other stuff, as i'm still brainstorming about basic problems, especially stuff for the (24/7 running) server to handle. E.g. the collision detection is completely client-based at the moment - hell, the server doesn't even know that there are bullets flying around! *braiiin braiiin... Also the enemy ships exist only locally on your computer yet, so don't be confused if a player shoots to directions where nothing is. But i'm so happy that the basic system works! You can't imagine how happy i was when i finally got the websocket connection working. Woohoo!
In the future i consider switching from 2D to 3D WebGL, at least for the engine itself - the graphics may remain 2D so optically not much would change in the first place. But hen i would have access to awesome shader effects (explosions? ;)) and real hardware acceleration. 2D is very resource hungry at the moment, check your task manager... As a perfectionist i always try to optimize everything, but there's nothing i can do about that. However, the browser engines constantly get better of course...
I tried it - looks rather nice.
The project plan looks quite ambitious, actually, so at first sight I thought you were just dreaming a lot higher than what you could actually do - as many people out there (often me included). But the result looks quite professional and I had to reconsider - you are doing a good job here.
One personal suggestion would be to make ship movement a little inertial (is this the right word? I'll explain better), that is: the ship doesn't instantly stop when you release the movement key, but moves on for a little (how much? it depends on you). Basically, you apply a force to the moving entity, instead of setting its speed directly, and the entity slows down when you release because another force (the friction) slows it down.
This would make the whole movement thing a lot more realistic with very little effort. At the moment movement is not much smooth, at least to me.
And please translate it in English! Or at least put it in the todo list... It would enlarge your audience a lot for sure.
Last, I'd point out (but maybe you know that) that the shield bar on the top doesn't reduce when your shield gets damaged, whereas health does.
Other than that, I'm positively impressed. Good work!
p.s. do you plan making source available - other than the 'view source' in the browser, something like a repository or similar?
Buch:
Yep, i know exactly what you mean. You're talking about friction and acceleration. Check out the little unfinished game i developed before i went multiplayer: http://space.bonsaiheld.org/ There the acceleration is already implemented. In the online game i haven't figured out yet how to do it - i might need time based animation on the server, which i haven't been able to yet. That's the reason why one can't die yet, as this would make the whole game asynchronous. So, yes it is on the to do list and will be one of the first things i do when the server finally has time based animation (at the moment, it's completely event-driven - if no signal comes in, it does nothing). :)
Yeah. I started translating after you wrote that. I will let it check automatically for the player's browser or system language and also provide an option on the esc menu to manually change the language. It already works and i already translated a few buttons. :)
Thanks, i didn't notice that. Fixed. :D
Thanks a bunch!
I'm into Open Source and Free Software myself, but the thing is that i'm too shy of such a big audience i would get at GitHub for example. And then it only takes little time i guess till the first push arrives... I you don't mind i will be honest and open: I'm psychologically not very stable and not "strong" enough to do this, if you understand what i mean. :) So positive feedback means very much to me and highly motivates me to continue the work. I will release everything when i feel ready. Also i want to rebuild the entire game later on the base of what i have learned so far. So yeah it is planned, for later. :)
It's looking great.
Putting the whole source for a complete game you passionately made is understandably scary. But even if you don't do it, it'd still be nice to read at some point in the future about what approaches to took for solving certain problems (entity spawning, server-client synchronization, camera, etc.).
Also, one idea for getting started with open sourcing your code, is to get in the habit of programming in little composable and generic (as in reusable) modules (or whatever you call the small pieces of your system that handle specific concerns). That way, even if the whole game source is too messy for a public audience, you could start by releasing just one of the modules you're using for certain functionality of the game (i.e. collision management, etc.) It'd be a lot easier to handle (and get something productive out of) harsh criticism on a small and specific part of your game's source, than it'd be to handle generalized criticism about the game's full source.
Anyways, good job so far!
You can give me a shout via <a href="https://twitter.com/lambdatoast">twitter</a>.
I'd appreciate some criticism. It seems no one ever even looks at my open source code. :)
HTML5 Canvas Old School RPG