Hello Riders,
Game is ready for Linux platform. Installation instructions are updated.
Hi, I see Overlap2dRenderer is doing the job, but it looks like it's doing too much for one system and at the same time like it could be difficult to split its logic on sub-systems. I could just recommend (1) convert everything possible to libgdx/bod2d domain objects (sprite/color/lighting/collisions...) and (2) assign component-system to these objects. I'm sure it's a big chance you will want add more functionality in scene renderer... into Overlap2dRenderer.
What about convertation overlap objects to scene objects https://github.com/DmitriyL/Feed-the-space/blob/ma... ?
It looks like you are reimplementing libgdx scene.
Day 15
Uploaded to github: https://github.com/DmitriyL/Feed-the-space
Run game: https://github.com/DmitriyL/Feed-the-space#run-gam...
PS: only half of initial backlog have been done... but you should play game at least due to 1 final scene.
Day 12
I've made some fixes fo AI and added heat damage when entity is too close to the sun.
For this I added triggers into Box2dSensorComponent:
And then in startSensorDetectsBody method which is called from 'Box2World > ContactListener > beginContact':
The same way for endTrigger in another method.
And user implementation of any trigger (in this case for sun damage):
Any entity gets damage each 0.5 seconds in area of sun body sensor.
Day 10. Turrets and solar system
Added solar system: each planet rotates around sun and around his axis.
Because of this change I had to rewrite StationaryGunSystem. It uses revoluteJoint's motor now.
It seams box2d has a bug for revoluteJoint with motor and angleLimits - solution here.
Turrets battle test:
Day 9. Stationary turrets
Yes... this is turret set on planet:
It has the simplest AI ever:
Where AiStaticAttackHelper tries to target enemy.
And at the same time StationaryGunSystem controls rotation of gun.
Day 8.
Completed basic ships AI (red ship is under AI control):
It's a simple system with step every 0.3 seconds which could call other subsystems by situation:
And example of what subsystem could do in 0.3 second step: AiAttackSystem
ECS magic step-by-step or "how to learn your animals move in world":
1. Rename ShipAiManager to AiPatrolManager
2. Create AiPatrolComponent for your animal entity (in my case it is on scene loader stage)
3. Profit! Space-Creatures moves by own business in space...
4. PS: do not forget to review usage of AiPatrolSystem when add attack action into patrol action :) or animals will attack player
Day 7
Congrats with a new year!
Part#1. Dialogs convertor
Today I've completed diagram-to-dialog convertor. And I have to say that it could be more difficult than I expected. Example of how simple dialog (2 entry points, 3 endings, 1 possibility to accept quest) could look like (big zoom just for total overview):
Groovy code generated from this diagram is completed on 95%. Then I add some custom conditions in several places and dialog is ready (in 2 variants for main planet and common planet of Lumen race). Here player could accept 1st quest for Lumen race.
Part#2 Basic AI & World simulations
I setup each planet to produce 1 ship each 5 seconds.
Then add basic AI component to each ship. In general each AI ship each second will raycast in looking direction to check on obstacles. If there are no obstacles - then move ~50 px / second. To avoid obstacles rotate on ~20 degrees.
Source code of AI processing here in gist
System has very general name, but it will be used like Patrol system soon. I'm going to add more AI behaviours and system for targeting enemy objects.
Now galaxy looks alive and crazy even with such simple AI.
Day 6.
At some moment I understood I want complex dialogs, but it's difficult to maintain quest branches looking into script code. So, I've created converter of visual graphs into script dialog. Graph is created in online diagram drawing tool (draw.io).
But it generates only skeleton of script. Then I will write readable descriptions and if needed modify any branch. Now need to think how better generate dialog with text or resource_ids.
Day 5.
Started creation of player actions menu. Player will be able to start dialog with any entity which provides dialog :)
Currently, player could start dialog with planet:
Implementation steps:
1) add ComponentWithDialog for certain planet entity
2) detect planet appears in camera view and refresh global visiblePlanets(entities) variable
3) start PlayerActionDialog (in my case it is button in UI) which will add options to call each planet(entity) in visiblePlanets(entities)
4) start selectedPlanet.dialog when player presses Call planet option
PS: each dialog is a custom implementation of state-machine with descriptions, options-for-selection, active-picture
Quest state-machine driver implementation
Day 4.
I've finished one of the central dialogs in game, where player gets answers about 'what is going on' and could accept/decline/ignore recomendations about 'what to do further'. However, it will be possible to complete game without main story and at least in 2 ways. This is the new goal.
I've created simple journal for automatic notations about key-events during story.
Connected PlayerInputSystem and CameraControllerFocusSystem to space-ship.
PlayerInputSystem - is a system which checks if keys are holding-down with adding movement vector to target Box2d body.
CameraControllerFocusSystem - is a system which adds movement vector to camera. Vector depends on distance from center of camera Rectangle to center of Rectangle which is ideally expected to be seen by player.
PS: also configured asteroid random groups spawns
Day 1
Just lets try!
Need to think about idea: it will be space... and some creatures in space... Well, enough for first time.
Need to choose tools:
Game: Feed the space