crash info is written into log file
Recent community posts
crash info is written into log file
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.
Uploaded to github: https://github.com/DmitriyL/Feed-the-space
PS: only half of initial backlog have been done... but you should play game at least due to 1 final scene.
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 11. Solar system races balance
Draft scene has been created with 5 planets and all possible forces:
More details will be added to solar system with testing performance. Diagonal of current scene is not bigger than radius of planned solar system.
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:
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
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.
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.
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:
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
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.
Day 3. Creating some intro dialogs. Nothing special...
Created CameraViewSensorSystem which detects moment when world-object appears in camera view:
This event triggers some events in world. In my case it started quest-dialog.
Created intro text-quest. Quest definition uses nice groovy script syntax for collections: Text-Quest state machine detects quest-options, closures or strings for text area, example in-game:
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