'Elroids' Developer Notes.
Source access
There is a, currently private, github repository here.
Alternatly it's all just script. You can 'inspect'/download the code from your browser.
There is also a facebook discussion group here. If
you want github access please join this and post a request to be added.
Known bugs
- Labels are in the foreground. If something passes between the viewer and a labeled object label will be
infront.
- Sometimes, e.g if rammed, can end up going faster than the maximum hull speed. Guess thats OK.
The 'Test Universe'
If the game is launched with parameter 'rockCount="0"' a 'Test Universe' is generated.
This contains a populated Universe and Ship with test versions of most things. Can be used for code testing.
Player ship is conveniently lined up for docking.
Ship will be loaded with some random cargo and have some random damge.
"'Someone else' can add unittests later." ... as 'idiots' like to say :-)
For notes on code operation/stucture see the Developer Code notes..
ToDos (In some sort of priority order)
V12.x Code improvements.
Add hit counter to elroids launch page.
Split Items into
- Regular items. Only persisted for active system. Cannot be JSON saved.
- Persisted items. Persisted when system inactive.
To decrease memory footprint delete non-persisted items when system deactivated.
Modify JSON to store/restore attitudes as Quarterion not Roll, Pitch and Yaw.
V13.x Rework saucers.
Saucers are a cludge left over from early development.
Make them NPShips. For a saucer the 'front' is probably the 'top' ... it moves sideways.
Convert to use regular AI.
Convert makeLoot() to loadRandom().
Modify saucer launch frequency to be based on time ... rather than number of animate cycles.
V14.x Improve NPShips
Remove HP ... use regular damage to systems instead ... if NPShips become too tough multiply the damage by some amount.
Less 'wild' navigation. Modify navigateThroughDest() to add lead. Possibly common code with attack().
Make miners less stupid. Dont charge in before all sub-rocks destroyed.
Don't 'stop' when attacking. Makes attacker an easy target.
V15.x General tidy up.
Make radar and compass components contain their own displays (like Huds).
Allow >1 ship to dock at the same time.
Add station aproach lights. Green - OK. Red - No docking. Yellow - Bad approach.
Don't show existing hull type in purchace list.
Convert GoodsList and ComponentsList to use classes ... like shipTypes in NPShipFactory.
Do a sweep of use of null. In most cases change to undefned.
Modify flame cones to grow/shrink when pulsed. Not flicker.
Possibly don't need extra 2D layer for lables ... make them part of HUD layer.
V16.x Fix game launch problems.
Add 'loading' screen.
Add a hit counter to lauch screen.
V17.x Add extra ship components.
- Thrusters (directional control)
- Extra avionics including:
- Docking computer (Base on BasicAI.dock()). Then make docking more difficult.
- Missile lock HUD.
- Homing missile
- Proximity missiles (mainly for use by the bad guys).
- Shields.
- Separate warp drive.
- Improved terminal (but keep VT100 as default).
V18.x Bulk up.
Add many more:
- Goods Types.
- Systems. Maybe proceduraly generated.
- Hull types.
Documentation.
Add screen shot with various display panels labled.
Add images (screen shots) of Items in place of game logo.
General 'good stuff' ... Post V18.0
Avoiding rocks were supposed to be a major part of this game. However it turns out that, in a 3D universe, the chance of getting hit is pretty small. I am told this is the case in real asteroid fields ... Maybe do something about it.
- Game mechanics:
- Improve 'vision through' wrap to take account of camera direction (i.e. dont just use
Universe.handleWrap()). i.e. allow rocks to be seen at full universe width not half.
- For ship/station interaction, once an rough aproximation to a collision is detected, it is
confirmed using ray tracing (Item.isPointInside()). Maybe extend to ray trace all the corners of
the Items bounding box.
- Carve the universe into 'cubes'. So don't have the square law issue of checking collisions
between everything and 'everthing else'. Just check the surrounding 9 cubes.
- In flight ship repairs based on expenditure of, purchable, 'univeral shunt' modules (goods) rather than
credits.
Possibly add reputation increase for trading.
Sort out menu system:
- Current code for buttons and scripts is ugly. Works in the context of MenuSystem, where it is evaled,
rather than it's own. Good enough for a 'minimum feature set' but needs a re-work.
- Currently buttons won't work on nested tables
- Re-work menu system as real HTML with style sheets to control look and feel. Back end to communicating
via HTTP with a, localy implemeneted in the client, 'HTML server'.
Possibly limit amount of goods available at stations.
- Maybe stations gradually 'grow' goods.
- Maybe station 'craft' goods from minerals delivered.
Try it with really big rocks.
Prettiness:
- Create 'exploding ship' animation. (Exploding Mesh? Then it could also do rocks/saucers etc.)
- Add surface texture to ship.
- Add lights to ships.
- Make saucers more 'shiny'. Probably involves MeshPhongMaterial ... but for me that just comes out white.
- Add extra vt100 features (e.g. block graphics) to ship control terminal.
- Fix audio to use THREE.PositionalAudio (Item.js.playSound()). I tried but cant get the listener to stay
stuck to the camera in all cases. Maybe add it to the Ship instead. Fell back on manually reducing volume
wih distance (and living without correct stereo).
- Make crater textures proceduraly generated (less download).
- Add 'tunnel' graphics when going through wormholes.
UI improvements:
Abstract keyboard controls to Events (Roll left, Pause, etc.) rather than characters. Makes switch to other
UIs easier.
- Add mouse controls.
- Make radar zoomable.
- Add joystick/tablet controls (maybe via on screen buttons reproducing keyboard keys). Maybe use tilt sensor
for movement.
Make key assignments configurable.
Extensions:
- Test on platforms other than PC/Chrome.
- Move code under npm repository.
- Make it multi-player (AJAX?).
- Add optional gravity effects (like Gravitar).
- Add on line high score (credits) table?
- Maybe collision damage should be proportional to mass and relative speed of colliding object. Common for
all items apart from 'rock on rock' impacts.
- Revisit inline 'ToDos'.
- Add 'toxic' crates. Triibles, bombs, xenomorphs.