[WIP] Hovercrafts Sandbox Prototype (Postponed)

Hi,

Roughly two weeks ago I started that little side project as prototype, about sandbox hovercrafts.
See quick vid in next post.

This project is a prototype, for my other bigger project, in which I want to test options, possibilities and limitations.

Project aim is, to allow players build own simplistic and futuristic hovercrafts, which can travel around the planets. Yes, planets as plural. See video, where hoercraft flies between one and other planet, by escaping gravity pull of one planet and entering into gravity of other planet. In fact Hovercraft as construct, is under gravity influence of all planets, at any given time.

Player Goal
One of player goals, is to capture hexagonal tails of planets.
These tiles will generate score and probably will be source of resources, for which will permit to build more etc.
Hence more captured tails = more resources.

I would like see, where this project may go.

I may add more description over the time, if I find a time.

8 Likes
1 Like

Some work over past week has been done.

Added some additional telemetry.
Latitude and Longitude on local current planet.

Player can move panels freely in the screen.

Nested joints structures.

Also, since I like data driven designs, I converted Json based saving system of construct, into SQLite format.

Adding very brief Player Goal to description.
One of player goals, is to capture hexagonal tails of planets.
These tiles will generate score and probably will be source of resources, for which will permit to build more etc.
Hence more captured tails = more resources.

I really like to get to the point of damage system. But I need have everything stable and possibly no bugs present.

Second update on the prototype, featuring wide range of improvements from propulsion control, multiple joints linking, to GUI with drag & snap, based on HTML5.

Also, added for now very crude Gyro GUI panel. To be improved.

For more, see time table below.

0:13 Two Worlds
0:21 Custom Designs
0:35 Flexible Propulsion
01:03 Hover Thrusters
01:20 Hovering Based On PI Controller
01:30 Test Drive
01:42 Manual Hovering Toggle on/off
01:48 Capture Tails
02:41 Go To Another Planet
02:59 Low Gravity
03:14 Spin Out Of Control
03:22 Multiple Camera Modes
03:48 Expand Builds
04:22 Add Multiple Linked Joints
05:04 Stability Test
05:41 Stargazing
05:50 Drag & Snap GUI Panels
06:10 HTML5 Based Moddable GUI

2 Likes

My prime project was using lua for modding blocks. It works great as expected.
However, I see limitation of such approach, if I want to use ECS. I know how I could go round the problem, to satisfy lua and ECS, but that way, I won’t be able to utilize full potential of ECS.

Therefore, I decided to roll in my own pseudo language for modding, which will be significantly different in terms of design architecture, compared to previous modding tool.

This will be quite a bit of work. But is better start early, instead of later tinkering, how to redesign and modify code, to fit modding mechanics.

The ultimate goal, is so mods can be stored in files, like csv for example.
I got concept of modular approach, so could be shareable across players.
Now getting into prototyping.

I hope some time in far future to get multiplier going, therefore, modularity is critical, to keep shareable files in small chunks.

To keep mods enclosed in safe sandbox, just like lua, no dll based mods are planned at this stage.

1 Like

I must say, for the short development time the result is impressive. Especially the ability to put your craft together in-game and the idea of modding and data-driven design.

2 Likes

Thx.
Yep implementing modding can be quite tricky.
And I know, as perhaps many do as well, if not thought about from the beginning of development, later can be difficult to implement.

However, I tested and did prototypes in past of multiple approaches, weighting which would be most suitable. So that helps a lot.

I aim, to allow modding accessibility for wider audience. Hence as I mentioned, I rejected for now dll based modding.
While some surely will prefer dlls approach etc. with later implementation of ECS, that would be potentially very difficult for many modders, due to low familiarity with Data Oriented Design. I may consider at some point tho.

Initially posted this in my wrong topic.
So moved here


Just quick update.

At the moment I work on stuff behind a scene.
Partially related to moddding, building core system.

But one of my main focus in general is a performance.
What I found common in games like Kerbal Space Program, Space Engineers, Rawbots, Robocraft, is a poor optimization. This may be because of the core design, or used older physics engine, only single core utilization, or maybe even other factors.
Specially issue become apparent,w hen player is trying go beyond relatively (for a game) big amount of components (100s-1000s).

On the opposite site, I find From The Depths, Where building flying machines made of 10 of thousands of components can run quite smooth. I am inspired by amount of optimization there.

Here I hope, my past few months of study on ECS, with some initial prototypes, including writing octree, will help to achieve this goal.

Other things in my scope are determinism and mentioned earlier (for far future) multiplier.
This things I need be thinking from the start, during design and developing.

I think major problem with making game optimization, once is advanced developed, or even released, is that developers either don’t bother about optimization, or hard to figure out how to optimize, or simply too complex to optimize, as it would require significant rework, of part of the game.

How and if I will achieve my goal, is yet to see day light. But is on the scope never the less.

All this of course will extend significantly the dev time. But I am not in rush to release. So I will take time, as long it needs to be.

Update #4
Jut brief on part of modding core.
So initially I did quick mocap, in OOP paradigm just to prove a concept.
Then started prototyping DOD system.
I think I got significant part working, but is not finished.
I did number of debugging along the line.

So now I am transiting part of the system to ECS, with multi threading support, as it will be easier from there, to expand further.

My nearest goal, is to get to the point, where I can use modding tool, to further develop game mechanics.
I will be happy, when that part will be functional. Or will be my failure :wink:
This way, I hope I should be able, to catch most of its quirks and make it as much user friendly as I will be able to.

Surely I got no lack of ideas and concepts, to keep me going.

3 Likes

Update #5

Not going into details, unless someone specifically is interested, but running initial stress testing of modding core on ECS, with 100k entities.

The result is promising. But I need run more complex stress testings at some point.

Ah, for curiosity I decided to turn off Burst compiler, on exact same code.
I did expect some improvement with burst, but that is just massive.

No burst

With burst

Just a quick update.

For modding purpose and to comply with my ECS core, I was looking for most suitable way, to parse expressions from strings, into executable code.

I aim, to be able execute similar to web JavaScript code like. For which, I got visual scripting solution mostly working and ready, from my older prototype project.

However, for now, I have no object oriented solution in mind yet. I may drop it for simplicity. But I want to run predefined and custom functions.
Therefore, I run few small prototypes, to test best feasibility.

Following this, I created topic for that purpose
Ordering math equation from pseudo code.
I decided to use Shunting Yard algorithm.
So far, so good.
But much more work is still needed.
Not that I haven’t expected. :wink:
I will get there eventually.

Anyway, that is it for now.

So far, I got working modding parser, which can interpret such functions:

function Start() {
  i = 50;
  x = 5;
  If100 = 20;
  if (i > If100 + 7) {
    x = -i;
    i = x + (If100 - 5) * 4;
  } else if (i < If100) {
    x = i + If100;
  } else {
    x =0 ;
  }
  j = x;
}

Now I need implement recognition of functions inside functions.
Both built in functions like sin, cos, pow, time, etc math access to construct, and world data; and custom functions. For example x = CustomFunction Start ( i );

The thing is, because I need to ensure determinism, I will allow only operations on ints.
Most of floats can be represented by ints, by multiplying 10^x. In worse case scenario, I can round floats to int, or to n decimal points, then multiply by 10^n. Yet I need to think about best solution, and make it as fool prove as I can, without over engineering.

As I mentioned in Ordering math equation from pseudo code. ECS at current state, do not support strings. Hence I have every string representation as int value. Best, is to think about enumerators, with assigned value. For example = is 0, + is 1, - is 2, * is 3 etc.

Manged to make custom and built in functions going.
For example:

function Start() {
  j = 1000 ;
  i = Test(j, 7) ;

  j = 1200 ;
  i = Test(j, 8) ;

  j = 1400 ;
  i = Test2(j, 9) ;
}

function Test(m, n) {
  k = Math.sin(m);
  return k;
}

function Test2(m, n) {
  k = Math.sin(m);
  return k;
}

Now I just need complete ‘for’ and ‘while’ loops.
Then more tests.

Also I did quite few optimizations, as I got quite few debugging logs, to track what is going on.

For me feels exciting :sunglasses:

I want get to the point, where I can start program blocks :stuck_out_tongue:

So it now appears, I got working core for all custom and built in functions, if, if else, for and while loops.
I need to say that dusting off some ancient knowledge about assembly language did help.
However, I haven’t used assembly, but I borrowed few techniques.
There is few things, I could approach slightly different, but I am happy so far.

I will be keep testing.

On technical side, I built part of this system, based of few modules.

  • First importing code as text.
  • Then is parsing of text based code, into lines of code.
  • After that, first pass decomposition separates relevant terms, including loops, variables and operators.
  • Also it adds special jump lines, to skip, or go back to relevant line of code. For example ‘else if’, or ‘for’ loops.
  • Then second pass, updates relevant skip lines, with correct line index and applies initial Shunting Yard algorithm.
  • Then next modules decouples text based decomposition, into numeric representation.
  • Then finally linearizing all data, into continuous arrays, to be compliant with ECS format.

From this point, I can run evaluator, which executes all code.

I could perhaps compress few steps into one, but since is easy to make mistake, this way I can easily track, what is going and where, since for most steps, I have debugging points, represented at enumerators, or strings. So kept readability. (These are only called at script initialization.) At least until linearization point, beyond which, all data is represented as numbers for performance, which makes difficult to debug, while is hard to be readable for human.

Ok, that it for now.

Next update #6, which involved prototyping of modding tool.

Commented in topic
** GameObject Tweening: Prove of concept using Native Arrays. **

So video briefly shows, ECS working with modding tool, where you can code it externally.
Multi threading now is supported.

So small thoughts to put away of my mind.
While currently focusing specifically on data driven side of project, such tasks are quite demanding. Is not complaining, but just saying, while passing by :wink:

Requires to think and rethink concepts, to ensure, systems and sub systems work as desired, yet not to fall, into spaghetti boloneze code like.

ECS is definitely helping, to keep code in tidy manner. (At least less messy :p)
Progressing in small chunks, bits by bits.

For sure, making all working in classic OOP would be lighting fast, just as I did first prototype, in comparison to ECS + OOP. But I hope, ECS will be the main strong hand later, in this project.

In the end, I am still working around the core of the game.

I think, while finishing what I am doing now, I should be able to implement multiple source gravity ECS systems, by the end of week. Unless, I will pick up different part of project to do instead. My to-do list is plenty.

Another quick update #7.

I hope all had and having good winter break, full of rest, getting ready for next year :wink:

This time some gravity implementation, which took me actually less than a very next day, from previous post. Now ECS side supports multiple gravity sources, as much wish for.

Then I worked on improvement of modding tools and bugs resolving.
Further to that, I have implemented built in PID controller.
This also should be possible, to be written with modding tool.

Then some further improvements, bit of cleaning and some small optimization.

Ah, and now I can executed major modding changes at runtime. At the moment quite in crude way, by triggering manually GameObject, to command ECS side.
Not as much, as would normally do, but here it is.

Just a bit more on video, there are 4 hover propulsions, to keep construct above the ground.
They are purely PID driven. Due to strong close gravity source and not fine tuned PIDs, hovering is rather hectic. When craft is moving sideways, the gravity force is acting toward gravity source, which is just few meters below the surface. Means pulling vector is not straight down, but mostly at some angle. This makes PID acting weird, as it looks.

Ok, now lets focus, I got few days untill end of the year, to finish a game :smile:

Edit:
One of update also I did, Improved time syncing, between systems Entities and GameObjects, with emphasis on determinism.

I got few directions to go as next. Inputs, octrees, or rebuild ECS building mechanics, as I had shown in Classic OOP on first videos.

Welcome back in 2019.

So for time being, after holidays, I was sitting on my side part of project ** [WIP] Octree In Pure ECS .**

I plan to implement it into the main project some time soon.
More about it is on its own thread, if anyone is curious.

On other side, I looked also into Utility AI, and I had great input from community so far.
** Utility AI (Discussion) **
This is something on my mind, do derive into ECS for as well, and combine with modding tools.
I got brief concept how I want to do it.

And I got few ideas of utilizing it already.

1 Like

Quick ECS based block building prototype, using Octree system.
Hence one step closer, to get to the point, of initial OPP based prototype.