@Antypodish some real intereseting stuff here. Any chance you have the source on github?
@iamthwee thx.
Sorry, no planning on source code to share at current time.
Fair enough, but a lot of people are getting started with DOTS myself included, it would be useful to see how youâre going about it, because you seem to have a good grasp of it.
@iamthwee as it is DOTS itself, I use many experimental features. I donât always know, which approach is best, or most optimal for given problem. So I try different things. I wouldnât call it most exemplary code, worth strictly studying. Potentially introducing unnecessary confusion, for someone who is learning DOTS.
Lets consider first DOTS FPS sample as an example, which was loaded with all mix of stuff and approaches. Was nice to look into it. But it wasnât what I really expected in terms of utilization of DOTS. There was too much noise for me, or I was not ready yet, to understand what is going on. Then I still refereed back to DOTS samples, as clean and simple examples. And of course, such great support on Unity forum.
I think DOTS samples present very good introduction, of how to bite specific problems. They narrow problem to minimum. Good basics blocks. I can not imagine better way to learn, even without current docs. Unity keeps updating them, with latest DOTS features. Which is something really nice.
Then we have Visual Scripting for DOTS, which allow to show principles, of building systems. Personally I donât use it. At least not in this project / not now.
DOTS Lambda is another thing, which I donât really fancy. Weather right, or wrong, I simply donât use it and I am not planning anytime soon. Maybe I am not convinced about it yet. However, I suspect, for someone who is starting, it may be good jump into DOTS approach, using lambdas.
Most likely, opening source code, would flood me with questions, why I did thing way I did, or what things actually do. They may have been very valid questions, considering rework etc. But I donât want to get occupied with such atm. I want make thing functional and playable first.
Oh my apology I was faster. I promie, I havenât looked into your notes on your desk
But out of curiosity, if willing to share, what was your concept regarding the âworldâ? Like in my case is the spherical planet. Was that something similar, or maybe more like Spore game of cellular game stage concept, or other?
It is so many ways, such game mechanics can be approached. That besides OOP, or DOTS.
I like that you brought organelles topic.
I was debating with myself, weather I should go more into that direction, regarding evolution of cells, or maybe more casual way, with more familiar terms by potential players. Not something that can not be changed, or added later of course.
And by all means, donât feel put of, because I make somehow similar game.
You probably could make something with different concept, game play etc.
Either way, it is good field to try and learn DOTS
Thx, I will keep posting.
In meantime, while dealing with X-Mas period, and eventually failure of my 5y old GPU, I managed to cobble something.
Somehow my GPUâs fan was lost capabilities of slowing down, making terrible noise. Cleaning and pulling it off, didnât resolved the issue. Somehow, after multiple trials and eventually, when installed alternative cooling and drivers update to GPU (somehow suspicious, but could be anything else), GPU decided to not talk to me anymore and switched permanently to VGA mode
I pulled it out completely, and replaced with even older alternative, which I had in my stock of spares. But that leaves me with one monitor unfortunately. At least for meantime.
Looks like it will be for me after X-Mas / new year shopping time, for new GPU.
Besides my little GPU ranting âŚ
Nothing specifically spectacular in recent coding, but I now converted my UI, into separate HTML, JS, CSS files, while previously I had them embedded in *.cs script. Which makes now nicer to work with, as I can focus on specific language.
While allowing modding is not my focus on this project, but that should potentially allow, for easier UI modding in future, as well, as applying HTML5 features, if I decide to.
Next thing on board, is to add a bit more interaction for a player, to allow a bit more control and involvement in direction of life forms evolution. I got partially core ready, but I havenât exposed hooks to UI.
Some added and little organised info to UI panels, and visual scaling values to display in units (like 1000 is 1.00).
Regarding the desk notes thing LOL no way dude. I understand coincidences happen.
The spherical surface thing is a really unique idea. There was a more 2d idea I had in mind.
Thereâs this weird habit of mine where I yearn to do something new and innovative, its bit of a personality quirk. Thatâs sort of what stops me from completing things at times.
Tell you one thing, you not alone with this one for sure. I love new tech and experimenting too. But I realized, just doing that, leads me nowhere. So I decided lock on focus. Is not easy however. But I keep trying
With little time to spare over holiday period.
Hope anyone had a good time.
I managed to squash few bugs here and there.
For example some unintended cells duplication.
Increased cells highlight intensity. But I need a bit more work on this, at some point in the future.
Implemented range selection via UI of life forms, also with respect to genes similarity.
Enabling multi direction cells grow of each life instance. This feature was shown in past, but I havenât really enabled it yet until now, as I needed work on other stuff first.
Of course faction marker is a bit too big atm
Happy New Year 2020
Update for V0.0.10
Here I got small update, which allows player, to display filtered cells of each life form.
It is basically a frame, which hides cells outside boundary. Later this hopefully should allow players, for better add, replace, or remove cells inside life form, or in particular place. Also the purpose, for better investigate, how life form is structured.
In red frames are marked sliders changes, besides top left screenshot, which is default rendering. Other renderings are representing highlighted life forms, with applied filter.
I think to let player choose, which and where new mutation should occur, by allowing growing new cell. This should bring more strategic management and potential better engagement to players.
AI for now, will be relay on random behavior, of mutations.
Once cell is mutated and gives offspring, such mutations are carried on.
I need also consider, if to leave certain random mutation factor for players as well.
These however, can be decided sometime in future.
Update for V0.0.11
Yep it was a while since last update. I do however go through big life changes, hence big stagnation.
But here whats is new.
I worked on life form builder and cell editor, as mutation.
At its current state it is in very crude form, but functional.
Existing life form can be mutated, as cell can be added, updated and removed.
I plan in future apply some restriction. Cost of energy, maybe some player earned points. Also possible limit on number of cells, that can be added per new life form. For now, it stays in debug / sandbox mode for testing.
Life Form Builder
Other than that:
- I tidied up number of scrips. Some refactoring and other organizational changes.
- Number of fixes to life form editor.
- Update to camera handling and filtering what is rendered, when switched to life form builder.
- Here I had to play a bit with shaders as well, to keep as much on DOTS side.
- A bit messing with GUI, html and js.
- Some experimenting with multiple cameras and skybox switch, to allow better visualization of the life form editor. However, for now I use single camera and just switch skybox.
- I broke sun rendering That Unlit shader of URP / Camera matter.
There is obviously lot of work with camera, when switching to editor mode.
Need sorting out editor life form going âundergroundâ, when adding vertically cells.
Also, I got some camera stuttering. Havenât investigated yet the source. Is not FPS issue however.
Next, I am planning finally, work with penalties for cells, depending on their position in life form and obstruction of other cells in same life form. Like for example blocked by other cell, sun light for chloroplasts, or sensory (sight / hearing / smell / other). While general problem is not difficult to solve, I want to do it optimally, to avoid unnecessary calculations when not needed, for example when individual cells are added / removed / updated. Problem is simpler, when creating all cells at once.
Yet I need figure out best way, to apply different penalties / bonuses for different type of cells.
There are also other matter on that part, but I leave it for later.
Basically tons of work is required behind the scene.
Update for V0.0.12.
Penalty system
I have implemented finally, basics of penalty system.
Chloroplast cells now obstructed from up to 5 directions, reduce their performance, proportionally, to number of obstructed sides.
Now I can apply obstruction penalty to any type of cells. But I need run more tests on that mechanics. Specially when adding and removing new individual cells.
UI small changes
I have modified part of UI, to display corrected data.
More stability
Then I focused on stability of the game.
I had a bit fighting with it for few hours, to track specific issue.
I decided to rearrange execution order of few systems, related to searching and consuming food.
Appears to be working so far.
That at least until 30th minute of accelerated runtime.
The error is however, from different shelf. I hope to track it down. Mater of be able to reproduce it first.
Below just for fun, planet (rather lack of it) with rendered lifeforms, populated and evolved from single chloroplast cell. I just gave it some boost at the beginning. Then let it be.
Screenshot however, probably looks very similar, to other one earlier posted.
Well changes were made ⌠at least you need keep me for a word
Bugs lurking
It is far however, from being even minimum playable as of yet.
There are certain bugs, which are lurking about. While I know how to track them, just didnât get change to put my foot on them.
Some inspiration time
On side note, a bit for inspiration, while I was looking for completely different, I found following
Coding Adventure: Simulating an Ecosystem
by Sebastian Lague YT channel.
Update for V0.0.13.
Just quick log update on current progress.
UI rendering filter
From simple parts of work, I have extended functionality of the rendering mesh filter
Added few more options. Later I want to make a UI matrix, to select particular filter on/off. I use bitmask for that, as it is convenient and simple to implement.
Annoying bug hunting
Another thing I was working, kept on optimizing and refactoring code. I wanted reduce utilization of DOTS Entity Command Buffer. I think that went ok. But I managed create bug, which I was hunting for few hours, causing critical error. I was debugging, putting logs and couldnât figure out. I even updated DOTS Unity Entities package.
Then eventually I have added another log, in the begging of the system I was working on. And of course, I realized I call system twice, as result of the previous testing and changes, while working on ECB reduction. Only that, I forgot to remove testing bit, duplicating system execution. Huh.
Now I removed faulty line of code and all seems work back smooth as butter. I will keep working a bit more on ECB reduction.
Changes to spatial mapping
Also, what I was changing, but yet not fully complete, is spatial mapping of lifeforms in the world. While I had own spatial mapping system in place already, using NativeArray, I was experimenting with borrowed concept of spatial mapping from DOTS Boids example, using hashmap. These are to look for available spaces near existing lifeforms, prevent overgrowing, if space is occupied and for hunting prays. It will most likely replace older mechanics.
Using NativeArray, or DOTS Dynamics Buffers concepts, were borrowed from my postponed project. However, there was spatial mapping per entity, using own octree system, to define blocks of construct and their local position. and compute flood algorithms. Also, there could be many complex constructs per world. Hence I opted out back then, from using hashmap, to avoid management nightmare and potential hash collisions. At least what I thought could be.
I donât need that here however, for defining local cells position in lifeforms. Complexity should be much lower. Hence I use different mechanics with hashmap for lifeforms and simplified grid system for storing cells. It is not even octree.
Current implementation is rather crude atm, but appears to be functioning so far.
More bugs hunting
And finally some general bugs fixing, which sneaked out behind my attention.
Great circle
On side note, just as I looked into scripts here and there, I remembered that for movement of lifeforms, I use calculations of great circle.
oh hey is this like conways game of life?
Hey,
Yes, that is the idea behind. At least what I am trying to do, but a bit simplified.
Update for V0.0.14.
Rather brief one:
- Camera motion improvements. I wake up morning, and came to me such obvious, that I forgot put camera transform in FixedUpdate. Instead I had it in Update, which caused previous camera motion jitter.
- Some corrections to cells index calculations.
- Updated random lifeforms movement behavior, when no pray was found and no sensory cells are available.
Now focusing on food searching, with / without sensory cells (like for example eyes).
Currently working on UI rework and prototype.
Since I starting adding more bits to UI and initial design was just hastily coded, I decided to sit a bit on it and do some major improvements. It is quite a bit of work, but it need be done at some point anyway. I think I am at good point, to redesign UI, based on knowing more-less what I need.
For now, on the screenshot all these are just test and template of UI elements with placeholders, with reference to previous UI.
-
I am doing major UI rework.
-
While is unfinished yet and not linked with correct data, I hope for significant simplification. But stil experimenting with things I must say, since UI layout is partially populated dynamically.
-
Using this time jQuery as my UI backbone, with HTML and CSS.
-
Bringing and expanding upon experience from my previous game prototype and combining with recent UI.
-
Nothing is definite.
-
Some of new features, which I wanted earlier to bring in are:
-
jQuery, over just javascript;
-
dual handled sliders,
-
functions simplification, do to use of jQuery;
-
Optional tooltips, when hovering over titles;
-
Draggable panels;
-
Resizable panels;
-
And some other minor backbone stuff;
-
Because all UI is written as HTML/jQuery/CSS, it can be technically modified by anyone.
-
Unfortunately panels blur does not work within a game. So possibly I will be needing to adjust transparency.
-
While most set of data was generated automatically, I want to simplify, how data communicate between UI and game. I am thinking about more generic methods, hopefully reducing number of methods to pass data, which may become messy otherwise. Still things are not 100% clear on final approach.
Thats going to be alot of work, best of luck bro
Yep. I got already some improvement in mechanics of UI itself.
But it is quite time consuming, testing different options. Once something works, then suddenly I change some order, and breaks. So I need rectify and look for source of issue.
For example in javascript there is console.log, equivalent of c# debug.log. I called console.log for debugging at certain point and it invalidated my array. Never had that bug before. Removing debugging solved that issue. So lots of little thins like that. But I am certainly moving forward
As I already mentioned earlier, I am still looking and testing optimal solutions for certain things.
Good thing is, I donât need to restart Unity runtime, every time I change something in UI, unless I modify actual cs files. I just reset UI interface, after javascript files changes, while game is still running.
This is massive time saver.
Update for version 0.0.15.
Been while, sine my last update, however, I rather been busy with other matters as priority.
Yet I did some major changes over the time.
- Tons of code refactoring.
- Hunting for bugs.
- Optimization.
- Continuous focus on determinism.
- Major HTML5 based UI changes and lots of additions. Colors fiddling.
- Adding skills mechanics, to allow life forms for faster growth, with additional light source. Is like a spell, where user move his pointer with a light bulb, which shines for few seconds. Any lifeform nearby with chloroplasts, can take an advantage of it. Strength also depends on the distance, form cast light.
- Adding and modifying custom URP shaders, to accommodate visual aspects. Here still using Shader Graph as base, then modifying generated shader scripts accordingly. That yet to be compatible with DOTS, which brings additional challenges.
- Changed shader for the atmosphere.
- On the image below, red cubes indicates chunks / regions, which are charged with points, based on lifeformâs faction.
Basically how it works is, when lifeforms exists, it charges the region that is present in it, to mark that is occupying it. The neighbor chunks are affected by influence, of âstrongerâ chunks. Player skills can be cast only in areas, of enough influenced regions / chunks, which spend that charge point. The brightness of cube/chunks indicates, level of the charge. Only percentage of stronger chunk is passed away. None occupied, or distance chunks, will decay over the time their charge. Only one faction can own the chunk.
However, this is not fully implemented feature yet and color will be depending on owned faction. So if faction is red, chunks are red. If influence of green faction is stronger, chunk will dim red color (strength) until reaching 0 level and turn accordingly to green.
- Highlighting lifeforms, now not only highlights themself, but also shows white borders around their cells, to make the more prominent and ease to see. This is purely custom shader side. No texture change is involved.
- While I have ported to Unity 2020.x, I am avoiding for now DOTS Lambda approach, since IJobForeachWithEntity is depreciated. I want make sure, I have valid candidate for replacement. Potentially, I may go back to lower abstraction Jobs. There is large topic on DOTS forum on that subject as well.
What next?
-
Infinitely lots
-
Of course more bugs hunting.
-
But major thing I want to change, is the way, how influence cube / chunks are presented.
-
I was thinking about using shader, and painting feature alike, to change texture color for planet regions, depending on lifeformsâ faction ownership. But I wasnât sure, how to bite efficiently the problem with DOTS.
-
However, I want make planet hex based. So I have OOP based hex planet generator, but I am writing now own ECS based hex planet generator, where each tile pentagon / hexagon is an entity. That involves mesh generation, UV assigning, and correct neighbor pent / hex tiles assigning, for future easier path planning. Still having some bugs on that side.
-
Then I want make tiles 3D, so their height can be changed as well, during planet initialization. This should allow to introduce some landscape variety.
-
Pent / Hex tiles would allow me, for better and more intuitive indication, which tile belongs to which faction. That of course on player benefit side as well.
-
That would be followed by further lifeforms interaction, with some environment influence.
-
Then further UI improvement.
-
Adding more skills, but that long way off goal.
-
Shader fixes.
-
Altitude fixes (see visible mesh cuts / overlaps in the ground).