SyntaxBomb - Indie Coders

General Category => Worklogs => Topic started by: iWasAdam on April 08, 2019, 07:52:20

Title: Strata Nova
Post by: iWasAdam on April 08, 2019, 07:52:20
This is a concept fork of Derrons' game 'Genus Prime'

What I liked the general concept of the strategy, the planets, etc and being able to send out things that you had no control over.

So here is a sort of thought-spam reworking looking at different aspects. feel free to comment, suggest, etc. the look it very basic as it is the game I would like to focus on.
So here is the first image
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-08-at-07.47.49.png)

the big yellow thing is the sun - which always sits at the center.
the yellow marks are the population - this automatically increases
the wide grey outline is the limit of travel

I've removed the multiple selection, as it sort of complicates things. but in essence each planet has 4 core things: food, power, research, travel plus population

the population has a max, and wont grow beyond the max. my thought here was when the max was reached you then have a point/s you can add to one of the core things.

So the first step would be to pick your 'home planet'
Title: Re: Strata Nova
Post by: Derron on April 08, 2019, 08:42:06
if the population reaches max - and you gain a "point to spent" you have to consider the amount of population to "cut".
If you cut too few, a big planet (with big population max) will give you point after point (as it wont get conquered too fast).

I had "food" (or some kind of directly-required-by-population-thing too). So my thoughts on this: food defines how "wealthy" the population is. Once the food is not enough (empty - eg the population eats every X cycles/seconds) the people starve. Starving means: population decreases, loyality decreases and with loyalty decrease eg the "planetary defense" wont eg. refill slower / shoot less often / ...
So satisfying your population results in a higher moral, better fertility (starving people give a f*** to f***), better defense, ...
Also Research Point generation can be directly connected to the populations loyality (or "happiness"). In Genus Prime I planned a bit to have the RP production be connected to "free" population units. So if you have eg. 20 missile slots then only the "population - 20" amount of people can do research. This adds to every other "job" people on a planet could have.

But bare in mind that this adds kind of complexity which does not fit to a more or less fast paced "action strategy game". This is more for the "tinker, optimize, plan ahead, ..." type of games.

Same for upgraded ships (transporters, destroyers, ...).


PS: As I did not have the time to add asteroids or other "interstellar objects": hope you add such accidental events (asteroids striving planets to destroy them, decrease population - or at least move their position a bit).


PPS: I just had another cool idea - dunno how to implement it "control" wise - but it might be interesting if the planets actually rotate around the sun. This can be done in a slow paced way so that a mouse user still can easily catch up.
So why to do such a thing? Imagine that some planets rotate faster than others around the sun (really?!!?). This means that some planet's distances to other planets differs - and so sometimes a planet is in ship reach, and sometimes not.
This could add another strategy element.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 08, 2019, 10:22:32
food linked to population growth - good thought :)

I know that the 4 bases covered everything, but I just wasn't sure how it would all fit together...
Title: Re: Strata Nova
Post by: iWasAdam on April 08, 2019, 11:23:05
yep, this sort of idea:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-08-at-11.19.54.png)
Title: Re: Strata Nova
Post by: Derron on April 08, 2019, 11:29:05
Overlapping planets (see orange and gray) might result in selection issues (if bigger planet is on top). So maybe keep it "top down" and the distance big enough to never collide ?

Exception is if it becomes a 3D game.


bye
Ron
Title: Re: Strata Nova
Post by: Derron on April 08, 2019, 11:32:37
Just another small idea to throw in: moons and belts/rings.

Moons could also orbit (non selectable) around planets and contain planetary defense. o
Or they indicate a higher ship range (the moon is used for the slingshot effect or so?)

Belts could increase production of something (so more an "indicator").


They are only basic ideas and maybe they already increase complexity/variety too much. Just wanted to do a bit brainstorming ;-)


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 08, 2019, 12:05:58
the moons idea is very interesting - but I think that is getting just a bit more complex at this stage.

selection is not an issue. it seems to work very well.

I've now added planets that are within travel distance:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-08-at-12.03.14.png)

as planets move, these lines appear when in proximity. Of course the planets are all moving, so you will have to make adjustments.
Title: Re: Strata Nova
Post by: Xerra on April 08, 2019, 16:52:08
Really curious to see where you guys end up going with this. Derrons game took a couple of go's to work out what I was doing when I first got it going but, once you get it, it's a really clever game. Considering it's only a small project it will be interesting to see a bigger game design based on it.
Title: Re: Strata Nova
Post by: Derron on April 08, 2019, 18:40:18
@Xerra
You needed multiple games to gasp what you need to do? Thats what I meant with being "blind" as developer - you think everything is self-explanatory by just looking at it. One of the reasons why I started to add tooltips to icons in TVTower. Think other parts in a game should receive some kind of "quick help" system too. Hit "F1" and the game stops + some tooltips to areas appear to explain what is there and what can you do with it. Hit F1 again and the help is gone + the game resumed.

Also interesting is, that in the "crash video" of Qube it already looked as if he was pretty used to this gameplay + controls. Looked very experienced.

Already am excited to get your feedback (and maybe also some of the others). Of course I would like to read that you (and others) liked it - as creating something which is enjoyed by others is a pretty cool reward for me as developer.


@ Strata
We - or most probably _I_ - should not push too many new ideas towards IWasAdam as the prototype might else do not longer _evolve_ but _mutate into something which Adam then no longer wants to develop further.
Seems at least as if he settled already to the scifi-theme with planets.

Some talk here already made me fill an old envelope (free paper notes ;-)) with sketches and rough ideas for an fantasy/medieval trading sim utilizing this "send and no further control" principle.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 09, 2019, 07:07:07
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-09-at-07.00.59.png)
Second bit of the ui being worked on, this replicates the planet population, so at a glance you know what is going on.

When the population if 'full', then research can start and research points will appear. You can spend research points increase the 4 main blocks: food, power, research, travel (i'll do this bit next)
Title: Re: Strata Nova
Post by: 3DzForMe on April 09, 2019, 07:50:02
Quote.   Already am excited to get your feedback (and maybe also some of the others). Of course I would like to read that you (and others) liked it - as creating something which is enjoyed by others is a pretty cool reward for me as developer.     

I was intrigued and amazed at the gameplay after sending stuff out from your planets that you'd no control over. The shear fluidity of the gameplay hit me straight away and has defo got legs.

Being a fan of homeworld and the like this game stands out for uniqueness that grabs you from the off.

Testament to it is Iwasadam moving the idea forwards already....kool and the gang! ;D
Title: Re: Strata Nova
Post by: iWasAdam on April 09, 2019, 08:17:48
agreed.
What I am finding is relating everything to everything else. so research is related to population and food and... etc

There is a time/strategy element as the planets rotate, so you will need to decide how you build up 4 core things. then decide how to use them.

I'm trying to do a bit of balancing as I go. And also looking at how systems with little travel would work. In that respect you would need to do research to enable travel

I'm using travel as a word to get from one place to another - this could be trade, or conquest, or raiding, or attack - not thought too hard on that one
Title: Re: Strata Nova
Post by: iWasAdam on April 09, 2019, 11:09:58
Some initial testing is working well.

My thoughts now turn to travel.
to travel you need a ship, a ship is constructed from research points, and lets compress things to (sortof):
2 = freighter
3 = shortrange fighter
5 = longrange fighter
10 = cruiser with 3 shortrange fighters
Title: Re: Strata Nova
Post by: Derron on April 09, 2019, 11:13:17
so you plan to either:
- set a production type which is produced until you select another one

or
- have to select a planet
- click on a button to produce a certain ship
- (fleet builts up without target)
- select a target to start the fleet maneuvre
?


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 09, 2019, 11:38:34
yep, it's per planet  8)

so 'currently' you select a planet, allocate research points, etc

in general operation you leave the planets to themselves as you are dealing with 'your' planet. Thus research points build up.
One a certain level of points has been reached, the planet will begin to allocate them itself - not yet written

I've now added the ability to set a homeworld (once 5 research points have amassed)
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-09-at-11.58.11.png)

in this case the planet Ver has been made the homeworld - the planet gets an icon and the text underneath it
Title: Re: Strata Nova
Post by: iWasAdam on April 10, 2019, 15:03:49
Sort of working on the initial ship stuff now:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-10-at-14.58.06.png)

When a ship is created it sits in stationary orbit until it has a destination

I've also been working on homeworld allocations and a base AI. In essence all planets are being tracked and research points are allocated when the AI feels it needs to. You pick your homeworld. the combator automatically picks it's own homeworld too.

I have run a few tests and  watched as the AI allocated resources and watched one planet go nuts with resources - very interesting stuff!

I am toying with the concept of triggers, so when resources reach a certain point then the planet would start to look for trade, or maybe conquest, etc...
Title: Re: Strata Nova
Post by: Derron on April 10, 2019, 15:41:16
Do not "trigger".
Give the AI priorities ... and maybe little tasks. These tasks need to get fulfilled and lower priorities when done.
So an explorative AI decides to build X ships. Task for X ships is created - and this leads to a task about collecting ressources ...
Once ressources are there, task is fulfilled - and the build-ship-task can get fulfilled too.

Using that approach allows for a versatility of AIs - with their own priorities (explorer, trader, ...).


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 11, 2019, 05:46:41
how would you approach the actual programming of an AI?
Title: Re: Strata Nova
Post by: Qube on April 11, 2019, 06:09:30
Quote from: iWasAdam on April 11, 2019, 05:46:41
how would you approach the actual programming of an AI?
In it's simplest form a state machine. Each AI action is based on a task so assign task IDs and action based on those. They call it AI but 99% of the time it's nowhere near it.
Title: Re: Strata Nova
Post by: iWasAdam on April 11, 2019, 06:37:59
That's the sort of thing I thought.

I suppose the thing about AI is it should be able to do its' thing without any interaction from you. So it should be able to function as a player with its' own goals - however those goals are decided.

Title: Re: Strata Nova
Post by: Derron on April 11, 2019, 06:44:04
Yes I do not talk about a "real" AI.
All computer player decisions I am talking about are based on priorities/weighting.
This prio/weighting is influenced by simple mathematic values.


In TVTower the AI has certain options what to do:
- plan their programme schedule (movies ad spots)
- buy new ad contracts/check what is offered
- buy new programme/check what is offered
- rent rooms
- plan new news shows
- ...

Now each of this tasks is identifyable by a simple TaskID. Behind every task is a more or less complex object. ("TaskType" or how you call it).
Each TaskType has functions/methods to retrieve priority information:
- GetSituationPriority() - task might analyze current situation/environment and adjust prio accordingly
- GetStrategicPriority() - task might return a "player character indivdiual" priority
- ...

The situation priority for example checks for the buyMoviesTask if we have enough programmes to broadcsst to avoid outages. In the signContractsTask we check for suiting contracts to estimated audience ratings.
And so on.
Of course these tasks might influence other tasks too. Eg the programmeScheduleTask can add requirements/subtasks to the signContractsTask ...so it knows what to look for without being strictly coupled to the programmeplan (logic decoupling).

Once the current task is completed, all tasks are sorted by their freshly calculated "final priority" (GetSituationPriority() + GetStrategicPriority() + ...  or multiply depending on how you connect stuff). The task with highest priority is choosen.


As this task system would not react to outside events, you could have a "update()" for each task - and/or some events they get informed about ("onPlanetGetAttacked()" or so).
Also you should have some "emergency" system which allows to abort a current task in favor of a more important one.

To have the AI "develop" in a basic sense you would save eg who attacked you where etc. (array of entries). Then during calculating "whom to attack" you could still use a random number but increase chances according to the percentage of attacks by this person.


For your game you would need eg. tasks like:
- ProduceShips
- HarvestRessources
...

Just think of a human player: what does he do? "ahh have to check if planet produces enough" ..."oh I got attacked, lets build ships to send them out".


At least this is similar to how TVTower-AI does it and of course it is far from the holy grail - but it is kind of a state machine which allows a pretty easy extension.


Edit: you posted meanwhile - the TVTower-AI can replace the human player ingame (with a dev command) and just takes what it gets to continue playing. So this system of course allows that.

bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 11, 2019, 11:53:17
mmmm

Watching the planets and their allocation of resources. They behave in some respects like the towns in 'Transport Tycoon'.

I've give each planet a ranged random trigger value. When this is reached then the planet has done enough research for space travel (of some kind).
My general thought is to see about using double the trigger value to decide the planet becomes hostile and more war-like (it might already be this, but if it isn't this becomes another trigger). That way there will be the possibility of conflict, and also there is how you decide to weight things yourself.

I would have thought that any planet you are in conflict with would not allow you to allocate their resources?
Title: Re: Strata Nova
Post by: Derron on April 11, 2019, 11:56:35
In an easy world yes, enemy <> trading partner.

In a real world ... commerce >> diplomacy.
If in war prices would increase (as it might be "illegal" to sell stuff). So give it a modifier "price = priceRaw * sympathyMod" or so. Sympathy depends on how friendly you are with them.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 11, 2019, 12:18:03
yep, I've now got a workable 'friend' system.

In essence you can allocate planets resources for them - they like that.
or the planet does it for themselves - they don't like that

So you have a sort of guide as to how they feel towards you...

Again, here I thought that a super high rating would mean they would join forces with you?
and a super low rating would mean they join forces with your enemy?

so there is a sort of management system going on
Title: Re: Strata Nova
Post by: Derron on April 11, 2019, 12:36:37
I would say each planet's "government" holds a sympathy for each other government.

so its not a "I like the human player" vs "I don't like the human player".


Depending on how many "governments" exist in a game you could even have this then:
Player 1 does X to Player 2
-> inform ALL players
-> adjust standings according to sympathy of Player X to Player 1 / to Player 2

That way a Player 3 which is a close friend of Player 2 looses a bit sympathy for Player 1 too when this one attacks Player 2


This "network" of sympathy can create a more vivid/lifely environment.


Similar can be said about prices: "oh you sell product X to planet Y for only 22 credits, we lower our prices from 36 to 33 now to accumulate that".
Similar can be said about... so much more stuff.


Of course this complicates a bit the code - but once you get uses to do it via an event system every interested object can react to your actions.


bye
Ron
Title: Re: Strata Nova
Post by: mainsworthy on April 11, 2019, 13:13:15
Hi Guys, Just to let you know I'm in the forum, I will readup this thread today, thanks for the link Adam
Title: Re: Strata Nova
Post by: mainsworthy on April 11, 2019, 13:56:41
I'm playing catchup here, but here are my thoughts on A.I.

First A.I. should be as simple as possible because this game suggests vast complexity, So I would have three variables for everything & three variables to oppose them ACTUALVAUE & TARGETVALUE & SPEEDVALUE, each gamecycle could be a timeloop say 1day, so all things happen in one day at SPEEDVALUE utill they reach TARGETVALUE. now all JOBS , TASKS , MOVEMENT , MILITARTY BATTLES ,have become automatic, just set the VALUES and watch the LOOP run one day at a time. I would also have OPPOSINGVALUES reduces ACTUALVALUE & SPEEDVALUE etc...


that's the system I would go with, if you want an A.I. its best to have a template in your head & simplicity is the key, I would run everything with this method, BUT you guys are so clever Im sure you can tweek it.
Title: Re: Strata Nova
Post by: iWasAdam on April 12, 2019, 06:02:39
That's a really interesting mechanic and one that can be coded very simply.

I could code up an AI variable class that would be the core of all other variables...
Title: Re: Strata Nova
Post by: Derron on April 12, 2019, 06:21:06
That is a static AI which ignores events happening between their daylie call.

Of course you have to set targets for your AI but current values are dynamic and might change with attacks, lost ships... So this needs to be taken into account.

Bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 12, 2019, 07:11:52
I've coded a base AI class with all the general stuff
I'll do a test with a ship and report
Title: Re: Strata Nova
Post by: iWasAdam on April 12, 2019, 08:49:07
This is some weird code!!!   :o

I've needed to extend it so there is a range. think of this as an error range. So the target can be within a certain range of values to be true.

Next up I needed to add a key. You give a key so when it says "i'm done" it gives you the key. you can then use the key to check things.

So... aiX and aiY have a start and target (with a +-range) and a key so you know whats happening on completion

I can also see that I will need to add composits, so that 2 values (x,y) can be tracked as a single unit
Title: Re: Strata Nova
Post by: Derron on April 12, 2019, 09:28:51
For what do you need a "key"?
For what do you need a range value?

You are talking in riddles.


planet.GetDistance(otherObject)
-> if value is below planet.shipRange (or ship.GetRange() if you ask for a specific range instead of the range currently built ships have) then you can send them out to that planet without being afraid to be out of fuel
-> you could ignore the movement of a planet since "ship start" to keep it simple
-> or you just ask for a "ship.CanReach(otherObject)" which calculates everything (effective distance including movement of the target and targetting the target position)


What is that key for?
event: onShipArrivesTarget
add yourself/player as listener and throw away ship events you are not interested in.


Also you could always have methods to access information. Assume all planets are owned by "player" (human player or one of the cpu players).
player.GetInformationXYZ()
-> method checks diplomacy state and returns information or null

Same could be done for planets.
planet.GetPopulation() -> returns population if allowed or -1 for not allowed
planet.GetShipCount() -> ... same


Just think of the whole stuff as "API". If you do that then the functions become no longer "planet.GetPopulation()" but "GetPlanetPopulation()" which does additional checks for you and calls "return planet.GetPopulation()" if you are allowed.
Same to do for interaction ("BuyShip(planetID)". That way you could more easily add multiplayer, AI controls, human controls, ...


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 12, 2019, 10:32:04
ok first the range
the target = target +- range. that way you can have the AI report back to you when the target is reached or within range of the target

next is the key.
The key is just in identifier, you don't need to use it. but...
Lets assume you have set up 4 AI's and each AI can have a different 'parent'

AI[1] reports it has reached the target. how do you know what the parent of that AI is?
Unless you are passing the parent to the AI, all the AI can do is report it has reached the target...

If you give the AI a unique key (lets say the index of the parent (could be anything, so an int value is best) that is sending it),
you can check the AI.Key, and decide what to do next.

In this case the AI has finished it's task and we modify the parent (given the key), by whatever we need to do.

Using this means all we have to do is set up the AI'a, let them do their work, update them, and do something once they have finished
Title: Re: Strata Nova
Post by: iWasAdam on April 12, 2019, 10:34:45
I should add that the signalling of the AI can occur at any time, all we are interested in is what to do when the signal is triggered.
Title: Re: Strata Nova
Post by: Derron on April 12, 2019, 11:10:24
To whom has the AI to signal back stuff? Who is interested in the fact that the AI knows that a ship is in range / a planet in reach ? Does the human player tell it to someone too?


Just update all AIs each update() you do.
The AI does something or not (it just updates their current task to do whatever the tasks need to do).
The AI has the information which player it controls (eg "playerID:int").

When it wants to know what planets it has access to:
API: GetPlayerPlanets(AI.playerID)
or direct: space.GetPlanets(AI.playerID)
... use the way to make sure that a player (human or CPU) cannot fetch information they are not allowed to retrieve. Eg. all know who is the owner of a planet so this information is publically available (planet.GetOwnerID()). Other stuff needs to be secured.
planet.SendShips(targetID) would be uncool to be publically available as with GetPlayerPlanets(enemyPlayerID)[0].SendShips(otherEnemyPlayerID) you could send out stuff.
That is where the API approach helps - every "API" gets a playerID assigned. The instance of the API is directly linked to a single player. That way "player.commands(or API).SendShipsFromPlanet(planetID, targetID)" is able to verify that the planetID belongs to the playerID stored in the API/command instance.


You can keep it simple if the AI is never done in an external/moddable file. So if the AI is stored in your own source code you can already make sure that it does only valid things. Then keep it simple and use "if planet.ownerID = playerID then planet.SendShips(targetID)".



@ finished task
If the AI finished its task it moves on with the next task. No need to inform anybody? Why should it? As said at the top of my post: does the human player inform others too once he finished checking all planet's ship production states?

The AI is like the human player: you split up all the possibilities you have into little tasks:
- check diplomacy
- check planet productions
- do military operations
- ...

Do nothing in parallel as the human could not do that too. Task by Task - and if you do it serious you even limit the AI a bit to be not too fast (adjust according to difficulty).
With this time limit in mind you might understand why the tasks need priorities - you cannot  execute all tasks in each AI cycle. You only have some ticks available (also to avoid lags - as some tasks are pretty time consuming). Means some tasks might even have to be split into multiple "cycles".
Imagine there are 1000 planets. Checking all of them each time means to check 1000 planets in milliseconds. Humans could not do that. Introduce "steps". Each AI cycle (or simple: during each ai.Update()) you increase the step. That way you know the progress of this task and could eg. scan the first 100, the second 100, ... planets. Like a human could do. One by one.

This cuts down AI processing time - i can tell you that a more complex AI (with more complex checks of properties, stored information about stuff happened in the past -> for proper estimations of what might happen next) can take some cpu cycles. So split up stuff.

Next to cutting down processing time this "step by step" and "priority" approach allows to "disturb" a task. Assume the human player is just checking some planets as the "under attack" sound is played and the screen turns red: of course he now reacts to this.
Doing a "step by step" thing means that you did not check every planet now (as the human was not able too). Yet the recalculation of priorities allows to now run the "UnderAttack" task for a quick reaction. Once this task is no longer of high priority (as the second-strike was executed and we are no longer under attack) the other tasks will be automatically executed then.

Goal of this to have a more "human like" reacting AI.

-----

QuoteIn this case the AI has finished it's task and we modify the parent (given the key), by whatever we need to do.

It seems you think of the AI as a "decision maker". You ask the AI what it would do, fetch the information and then actually execute what the AI planned to do?

My approach is more of a "controller":
- human uses input device + GUI/HUD to execute commands (planet.SendShip())
- AI uses its own commands to do stuff (planet.SendShip())

In my idea the AI directly does its stuff, no further interaction or "return values" needed.

That way you could also easily replace the AI with a remote (network/internet) player as it just uses another layer (transport their "input device + GUI/HUD" via networking packages to you - and run the same commands then according to the incoming data).


Maybe at the end we talk about the same but as said I think you decouple the AI from the actual player object. More like a brain which you ask for decisions/help/what-to-do. While my idea is to give the player object an AI brain and let the player then do its stuff without my help.


bye
Ron
Title: Re: Strata Nova
Post by: mainsworthy on April 13, 2019, 13:45:31
off on holiday, catchup in a few!

the A.I. is static because it needs to be doing stuff on its own in RTS, but the Values can be added or subtracted with the 3 opposing values, the opposing values are targetvalues for the 3 values of each entity, so if a planets growth is 1 population a year it will do that auto, but if your opposing value is +2 you would get 3 population , or it could be negative eg -3 then the pop would be -2 a year, the A.I. only has to be controlled by setting the 3 default values for every entity - the as things happen the opposing values get adjusted. I don't have time to read back what you've wrote, Im out the door on holiday guys bye for now.

PS: you guys need to go to humblebundle and grab the 8 bit game dev bundle, they have two bundles one is books but the other is graphics etc... do it now now now
Title: Re: Strata Nova
Post by: Derron on April 13, 2019, 13:51:07
@ mainsworthy (even if you are off on holiday now)
I do not understand what these "three values" have to say?
I am not talking about values which automatically grow, stay or decrease.

I am talking about algorithms making "decisions". For this other players have to be taken into consideration and actions have to be done according to stuff considered before.
Basic number values can just be used to "weight" actions:
a player attacks a planet? "defense priority :+ 1"
planet is nearby? prio :+ 2
planet is of ally? prio :+ 3 * SympathyForAllyMod() (so a sooner or later ending partnership could influence prio)
planet is nearby? prio :+ 1
planet is ours? prio :+ 100


Aside of that I do not understand how the 3 values lead to a "human like acting" AI.

PS: Why needs the AI to be "static" in an RTS? I am not talking about path finding or decision making for individual units of the AI. I am talking about the AI as a "player" (controlling the whole army of units).

bye
Ron
Title: Re: Strata Nova
Post by: chessish on April 13, 2019, 22:03:00
I wish you good luck with this!
Title: Re: Strata Nova
Post by: iWasAdam on April 14, 2019, 10:25:23
thanks for that :)
it's creeping along. Finally got the first ship operational: cargo transporter!
Title: Re: Strata Nova
Post by: mainsworthy on April 15, 2019, 15:30:06
@Derron, thanks cleared it up nicely for me, I was making a gaf not reading because I was packing, car broke so waiting for part at garage.

but if your talking about an A.I. there is two different ways to look at it , its the thought process & the practical implementation, I have seen people say they would like me to program a boardgame into a computer because they have designed an A.I... they have the thought process but the pracycal way to do it looks completely different to me atleast.

I think there are two ways to looks at it, EG analog & digital, we will never implement an analog A.I. that thinks like us, but a didgital has boundaries, boxes and borders.

I think if I was designing this I would look at the data like water, move all the data in a flow and where it swells it gets over the bank, or like magnets what a node wants and what it gives, so all the wants get fed and all the gives feeds the others, whats left is your swell over the bank, so find all the surplus and figure out what the different parts can build, the surplus should include time as a surplus too, EG you may have a predicted weeks manufacturing & 1000 tons of food & 800 tons of oil & 300 tons of metal,,,, now your algo can choose what to make with it, it may decide on tanks with metal oil and manufacturing.

Im not a genious like you guys you've been at this longer. Just trying to put another viewpoint on it.
Title: Re: Strata Nova
Post by: Derron on April 15, 2019, 16:53:56
Thanks for your input.

I think you should not think in "what can I do with XYZ terms" but sometimes also "what is needed to be able to do".

In other words: the AI needs to have targets which sometimes cannot get simply expressed in some plain numbers (not exactly true as you can split your complex target into numbers "build up an army" = "at least X tanks, y foot soldiers ,... "). Also influence to decisions should be based on plenty of inputs to make them less predictable (while they "mathematically" are still predictable). The more input is taken into consideration the more interesting (and varying) it will play. This is why many of my gameobjects in TVTower contain "x * GetXyzMod() * GetAbcMod()" calculations. Behind each mod some other modifications and temp-wise "current values" (eg people currently in front of a TV, not at work, not in bed ...) build dynamically but still "reproduceable" numbers. This automates the process of audience flows (not strictly true as there is another algorithm in the game for this too) and other stuff as all these little wheels automatically influence other wheels.
This makes balancing a lot harder (because its hard to grasp what really influences something) but at least for me it feels more "magical" then (while you of course are able to understand the major factors in a calculation).

This is why eg "GetSympathyMod(playerID)" versus the planet owners in Strata might be more interesting than "5 * IsInWarWith(playerID)".



My approach of "tasks" is not in a "computer programme task" sense but like a task you as a human would tackle: "check your planets", "plan an attack", ...as said this is done that way to mimic a slightly "human-like" AI instead of a machine/follow-an-algorithm computer player.
Also this means that eg. the AI in TVTower does not cheat and "remembers" stuff etc.



bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 19, 2019, 12:13:47
ok, back to scratch  ;D

There were all sorts of strange little things with the previous version. but brilliant for prototyping and seeing where the problems are.

taking all of what existed and starting again with the initial planets system. This time the display can be at any angle and zooming is supported, along with planets having moons. game speed is also included:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-19-at-12.04.50.png)
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-19-at-12.04.34.png)
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-19-at-12.04.28.png)

internally the code is now really simple. with classes added to simply things further

Next up will be to add a more refined version of the ship code to test things
Title: Re: Strata Nova
Post by: iWasAdam on April 19, 2019, 15:32:23
trying to make the planetary orbits less flat:  8)
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-19-at-15.30.19.png)

(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-19-at-15.30.36.png)
Title: Re: Strata Nova
Post by: iWasAdam on April 20, 2019, 07:49:01
more tweaking and a little visual stuff later and I think that the general systems are working well:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-20-at-07.47.07.png)

it has a much more sci-fi feel to it which I think is a good look to go for?
Title: Re: Strata Nova
Post by: 3DzForMe on April 20, 2019, 08:01:03
Quoteit has a much more sci-fi feel to it which I think is a good look to go for?

Visually very impressive stuff - oh yes very good  :D
Title: Re: Strata Nova
Post by: Steve Elliott on April 20, 2019, 10:27:01
Quote
it has a much more sci-fi feel to it which I think is a good look to go for?

Yes, I like the way this looks.
Title: Re: Strata Nova
Post by: iWasAdam on April 20, 2019, 11:31:53
Good to know I'm sort on the right track now.

There are a lot of very odd things that need to be sorted. planets, movement and orbits is one, the ui is another...

Next will be basic ships having destination and source - the previous version just didn't work correctly and there seemed to be a lot of cpu use going on (not exactly sure where?). But this time I am approaching it with the past code in mind...
Title: Re: Strata Nova
Post by: Derron on April 20, 2019, 16:00:28
For ships I had a simple system:
TSpacecraft (base for TMissile and TShip) had a simple sourcePlanetID and targetShipID (missiles were not able to target missiles, so targetSpacecraftID could work too) and a targetPlanetID.

When updating a ship it called UpdateMovement() - which changed effective velocity based on the own position towards the target position.
This was needed to implement that way as objects in space tend to change their position.

To make it effective you need a fast "ID->object" retrieval aproach. I used Brucey's TIntMap (so no "string/object"->object map like in original BlitzMax but a optimized number->object map). With Monkey2 you might have a similar lookup table object.
If you are not afraid of possible circular references you could avoid loose coupling (id-lookups) and directly store the "target:TSpaceEntity" (planets, ships , ...) and just request its current (cached!) position in space.
Think this isn't that cpu costly then and should be the way to go.


What's a bit more time consuming? The pathfinding - especially with the avoidance of obstacles.
You could do the simple a-star-pathfinding and mark "grids" as occupied/blocked or not (so planets occupy grids). Grid states would need to get cached so that blocking/owner states do not lead to costly calculations. Means: a planet moves and refreshes its grid position - this informs the grid system and it sets the corresponding cell's ownership (so "flyby/harbor-approach" would be possible - compared to "avoidance").
This is better as it allows to also make the targetplanet "reachable".


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 21, 2019, 08:21:14
interesting.

I'm definitely not using any of the Map functions - I don't know what it is, but I have always had the feeling there is something not right in the internals of it. I've certainly come across strange allocation issues in the past.

For the resources lists, etc - I have a very simple but completely bomb proof way of dealing with index entries that doesn't shift data around and combines the best of arrays with lists.

Here's the updated UI with details being shown:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-21-at-07.49.25.png)
Title: Re: Strata Nova
Post by: Derron on April 21, 2019, 09:08:57
@ Maps etc.:
If you iterate over a list/map/bag/... and inbetween remove one of the entries you are doing a "concurrent modification".
Assume you have an array:
Code (Blitzmax) Select

For local i:int = 0 until array.length
  processEntry( array[i] )
Next

Now the processing of the 10th element (i = 9) removes itself from the array somehow.
Eg. "Remove(me)" -> array = array[.. myID] + array[myID+1 ..]). This means that at "i = 9" now the old "i=10" is stored, at "i = 10" you will find the previously 11th element and so on - they shift -1.

The for loop is not knowing about the change. It now processes the 10th element after this 9th element (which removed itself). But this means it actually processes the element previously stored at the index=11. The index "10" (which is now stored at "9" because the old "9" was removed) is skipped in the whole update process.


In the example above this leads to "just" a skipped update - but now assume you somewhere start a process which identifies indexes for deletion. If you now do a "step by step" deletion (1st item, then 2nd of the delete-index, then 3rd.) you are actually deleting the wrong elements as they "shift" inbetween.

So for arrays this means you better create a new array containing all elements not being in the array containing the "to delete indices". Or you subtract a "deletedAmount" to the index access so it takes the shift into consideration.
For array the "new array" might be better as each "arr = arr[..index] + arr[index+1. .]" creates already new arrays (memory, cpu ...).


Hash maps, linked lists ... work differently for having elements linking other entries in the map together - so if removing them these links get updated and it should work too. Yet eg. in BlitzMax (NG) TMap and TList had issues with concurrent modification too.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 21, 2019, 10:29:14
Again interesting to see. but not a solution I would ever use in code as it 'data hides' the intention.

My preference is to go for some base container class with a kind variable.
if the kind = NULL then don't process

loop through all units and check if they are valid and then do something. That way you are 'checking' for known valid stuff and doing known things to the data.

TMaps / hash tables, etc do their best to hide what is being done - which in turn (for me) makes the code very difficult to read and work out what is going on.  :-[

I also feel that data is always reliant on other data and data references. The code gets very nasty and adding (hiding) stuff into the mix just makes it more complex.
Title: Re: Strata Nova
Post by: Derron on April 21, 2019, 10:41:48
Maps, lists, ... they are all some kind of "container" in which you throw stuff. Some behave like shelves (maps), some like stacking boxes (arrays) and some like bags (TList - sort order defines the "heaviest" which lands at the bottom).

I assume you use some kind of "pool" mechanism. You have a set of 1000 entities - if a ship is dead it changes entityType from ship to "none" and then this is an entity which can get reused.

Any usage of this ship either needs a lookup (from the "1000 entries array" - expensive) or you need to cache this lookup by providing a reference ("field target:TEntity = ship"). Now I assume your element having such a reference checks the containing entities for being not "none" each time - or to only process stuff if it is not "none" ?


@ hide away
I love this "hide away" in most cases as it allows to keep code "easy": container - add, remove, get. And you get that often for free, no need to write the code for it.
Performance wise there might be better options but especially for our "fire and forget" projects it's nice to save some time - and maybe avoid bugs (not that much apparant in "matured modules").
This is one of the reasons to have sprite classes, bitmap font classes ... you are not interested in the implementation. Just have "sprite.Draw(x,y)" and it works, do a "sprite.DrawArea(x,y,w,h)" and it handles it according to the sprites definition (stretch, tile, 9patch, ...). Same for lists, maps, arrays.

Yet your solution might have some benefits too - might depend on the project what outweights the other approach.




bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 21, 2019, 12:11:46
Sorting out some resolution independent scalable graphics:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-21-at-12.09.41.png)
Title: Re: Strata Nova
Post by: iWasAdam on April 22, 2019, 11:35:17
more UI and added rotations to planets:
Still no Game, but I am having fun watching planetary motions :)
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-22-at-11.33.45.png)
Title: Re: Strata Nova
Post by: Steve Elliott on April 22, 2019, 13:34:46
lol having fun then, looks great.  The white symbols look a bit out of place, maybe a light green or blue/green colour instead?
Title: Re: Strata Nova
Post by: iWasAdam on April 23, 2019, 07:34:32
Yep... a lot is still just placeholders, so colors, graphics - everything is likely to change in some way.

After throwing a hissy-fit and eating all the chocolate yesterday. I cracked a problem I was having:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-23-at-07.28.32.png)

It's not much to look at..., but it actually correctly depth sorting the planets as they rotate plus line widths are also being correctly scaled! I should add there is NO 3d being used. just some sin and cos and 2d graphics 8)

As was once sung:
It's a Sin!
Title: Re: Strata Nova
Post by: iWasAdam on April 24, 2019, 08:06:31
if only I could turn a bitmap into a planet?  :(
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-06.41.01.png)
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-08.05.13.png)
Title: Re: Strata Nova
Post by: iWasAdam on April 24, 2019, 08:58:36
Nailed it!  ;D
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-08.58.10.png)
Title: Re: Strata Nova
Post by: Derron on April 24, 2019, 10:57:10
As I am a nitpicker: the light should be coming from the sun :p


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 24, 2019, 10:57:23
and with a bit of color variation:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-10.56.21.png)
Title: Re: Strata Nova
Post by: iWasAdam on April 24, 2019, 11:03:23
the sun isn't shown, but I'm allowing for that with auto shadowing.

Don't forget there is NO 3d used - this is all 2d!
Title: Re: Strata Nova
Post by: therevills on April 24, 2019, 11:14:26
I actually like the wire-frame look!  8)
Title: Re: Strata Nova
Post by: Derron on April 24, 2019, 11:30:04
You might not use 3D stuff but still display it 3D and use the corresponding maths. Dunno how to describe that in other words.


@ sun
You know I did not mean it serious ?!


PS: I do not prefer the the wireframe look as it will look be pretty stuffed sooner or later. For a minimap or 80s "analysis screen" this might work well but for a sleezy scifi strategy game you can use a more cheering display variant.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 24, 2019, 12:27:04
I've got an idea of merging the wireframe and 2d look into one system. So these are the tests of getting a flat rectangle to look like a solid orb.

Here with a shader and 3 different materials:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-12.18.16.png)

@Derron - the sun has been taken into account. the above is with the sun facing the planet. and here with the planets in front of the sun (shadowed):
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-12.21.50.png)

You can also see that the planet surfaces are not static! - they can rotate and have the surface reflect the rotation as well

Just for Derron:
Nope, you can't use the same maths for 2d as you use for 3d. There are no matrix being used or depth. These are actually flat planes on the same canvas with no depth. Everything you see has had to be constructed from a flat image - No normals, no vertexes (apart from 4 corners), no lighting, no nothing! The things that are used are (my versions) of Spherical mapping, fisheye and some dirty uv mapping.

Here is the same with the last planet showing without and with the shader:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-12.31.13.png)

So you can see that the input is just a flat colored image...
Title: Re: Strata Nova
Post by: Derron on April 24, 2019, 12:38:20
Lighting looks cool.

Thanks for the explanation.


Maybe ... maybe we can whip up some procedural textures for the planets (We have users here in the forums doing stellar simulation games ... maybe they enjoy it). Different Ice planets and so on. Could be cool stuff.

Next to the planets yo will have to come up with "rings" (which should be split into two parts for "front" and "background" of a planet).



bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 24, 2019, 12:43:19
The textures are all taken care off...  8)
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-12.41.45.png)

yep. ring would be simple to do
Title: Re: Strata Nova
Post by: iWasAdam on April 24, 2019, 12:47:28
So...(this is the concept photoshop version), we could end up with something like:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-12.41.46.png)
Title: Re: Strata Nova
Post by: iWasAdam on April 24, 2019, 15:11:50
Lets get carried away and dream...  :o
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-24-at-14.55.0x.png)

(spaceship not mine, just quickly photoshopped in)
Title: Re: Strata Nova
Post by: iWasAdam on April 25, 2019, 08:59:19
First integration test with shader:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-25-at-08.57.43.png)

basically you can see the far planets are behind and the near planets in-front, with the shader operating correctly as a sun.
Title: Re: Strata Nova
Post by: Derron on April 25, 2019, 09:18:39
This will look sweet with some parallax-effect in the background (1-2 layers of stars or even two dozen of "star objects" with individual depths for a more immersive scrolling). Especially when rotating the view.


Nonetheless - and I know how nice it is to "play around" - do not loose focus on the game itself.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 25, 2019, 11:48:57
yep, star-fields would be nice :)

Shaders integrated, but shadow errors meant they are currently removed :(
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-25-at-11.46.46.png)
Title: Re: Strata Nova
Post by: iWasAdam on April 25, 2019, 15:19:26
all corrected now with shadows and completely random planets and moons:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-25-at-15.18.12.png)
Title: Re: Strata Nova
Post by: iWasAdam on April 26, 2019, 07:07:07
There was going to be nothing to show for a while, but as I've been working on the starfield stuff. I thought someone might like to see the results:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-26-at-07.01.52.png)

(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-26-at-07.00.32.png)

and my favourite one:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-26-at-07.03.47.png)
Title: Re: Strata Nova
Post by: Derron on April 26, 2019, 07:10:16
Think it might look pretty nice when in movement.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 26, 2019, 07:55:25
Here it is in motion with me changing the visuals as it plays:
(https://vjointeractive.files.wordpress.com/2019/04/planets.gif)
Title: Re: Strata Nova
Post by: Derron on April 26, 2019, 08:35:19
THIS. LOOKS. GREAT.

Ok, minor things:
sun "pulsates" too fast in my opinion. If you wrote some interpolation stuff then the scale could be done "non linear" - eg use "bounce" or "quad" or so ... just to make it more interesting.

Why slower? if it is too fast then it attracts too much attention of the viewer.


Next the texture of the planets is not "smooth" (filtered) this way the rotation looks more pixelated then it should. Dunno if you can improve that.



Side note for interested tinker-boys: if you added a second layer to some planets containing only some clouds you could move them at a custom speed (slow) to make it even look cooler and more "lively".

Depending on performance issues I would set them up as "optional" (you can disable it).


@ rings
I mentioned planet rings already. Will look cool too. Hope it all in all does not become "too much" on screen then.


bye
Ron
Title: Re: Strata Nova
Post by: 3DzForMe on April 26, 2019, 08:43:21
Quote.   Side note for interested tinker-boys: if you added a second layer to some planets containing only some clouds you could move them at a custom speed (slow) to make it even look cooler and more "lively".   

This does sound like a great effect. I really like where this is going  ;)

I
Quote. Here it is in motion with me changing the visuals as it plays:   

Oh yes, verrry impressive! 8)
Title: Re: Strata Nova
Post by: iWasAdam on April 26, 2019, 11:50:07
all above sorted:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-26-at-11.48.03.png)

includes better pulsing of sun, additional clouds and rings. added in orbit lines and it is starting to make sense again :)

QuoteDepending on performance issues
virtually no performance hit for all the visual trickery - it's all on the GPU

and remember... NO 3d!!
Here showing orbit lines and selected planet:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-26-at-11.53.38.png)
Title: Re: Strata Nova
Post by: Derron on April 26, 2019, 13:38:02
Looks pleasing to the eyes.

With your 2D aproach the only way for anti-aliased outlines of the planets is to render them at 2x the size on a new texture (render to texture) and then to scale them down to 0.5, 0.5 so it utilized the texture filtering through the GPU.
Or there is an even simpler solution with shaders - I am not experienced in this regards.

bye
Ron
Title: Re: Strata Nova
Post by: Steve Elliott on April 26, 2019, 14:37:35
Quote
With your 2D aproach the only way for anti-aliased outlines of the planets is to render them at 2x the size on a new texture (render to texture) and then to scale them down to 0.5, 0.5 so it utilized the texture filtering through the GPU.

...or just soften the png edges a little in a Photoshop-type Program.   ;D
Title: Re: Strata Nova
Post by: Derron on April 26, 2019, 14:39:28
Which png edges?

IWasAdam is drawing the circles "live" (so maybe some kind of textured poly). The rotation is simulated by moving the texture over this poly.


bye
Ron
Title: Re: Strata Nova
Post by: Steve Elliott on April 26, 2019, 14:42:19
Ah ok, then a shader could be used to anti-alias.
Title: Re: Strata Nova
Post by: Qube on April 26, 2019, 18:42:26
Looking good ;D Make sure you test your shader goodness on other hardware / OS's though :)

QuoteOr there is an even simpler solution with shaders - I am not experienced in this regards.
Just had a very quick look at a FXAA (https://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/3/) shader for openGL. Doesn't look too crazy but I'm not experienced with them either. I know there are other AA methods which produce better results but are more GPU / memory costly so I doubt you'd need to go crazy on the AA side for things beyond something light and simple.
Title: Re: Strata Nova
Post by: Derron on April 26, 2019, 19:27:44
Thanks for the link..but it seems as if fxaa is pretty costly.
There is no need for a full screen AA as the background image etc already look good.

It just needs the planets / overlays to be AA'd. Which is why I suggested to render each planet at 2x on an individual texture. Then render these textures at a scale of 50% ...it should then automatically be smoothed out.

If texts are already smooth (ttf and freetype) then you might render it afterwards to avoid "oversmoothing".

Utilizing render2texture can even speed up rendering for composite images with an animation speed lower than a pixel per frame.

Bye
Ron
Title: Re: Strata Nova
Post by: Qube on April 26, 2019, 20:13:14
QuoteThanks for the link..but it seems as if fxaa is pretty costly.
No it's not costly. The clue's in the name "Fast approximate anti-aliasing". It can be applied to a texture and does not have to be full screen. It is also virtually cost free on a modest GPU
Title: Re: Strata Nova
Post by: Derron on April 26, 2019, 20:26:58
Was just judging on the framerates in your link.

If it works on textures than...this might be worth a try (if possible).


Bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 27, 2019, 07:12:05
planet edges now have alpha blending:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-27-at-07.09.41.png)

I needed to tinker and play with the shader until it sorta seemed right
Title: Re: Strata Nova
Post by: Derron on April 27, 2019, 07:17:04
If you want - feel free to drop 2-3 sentences to describe how you eg. approached the anti-aliasing.

Think visually it is 'nough done for now (we will talk about the planet-HUD/info display once you settled for the information to display there). Back to the actual game development.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 27, 2019, 07:31:21
ok, the alpha in the shader is not quite as simple as you'd think it was
you have the alpha. and the color must also be multiplied by the alpha to give the correct result

here is the code:

if (radius < innerline){
//inside the planet so alpha is 1
alpha = 1.0;
}else{
//edge of planet, modify the color and alpha
alpha = 1.0 - ((radius-innerline)*30.0);
col *= alpha;
}


so find the edge - move in a bit, and fade this 'bit'
Title: Re: Strata Nova
Post by: iWasAdam on April 27, 2019, 08:35:55
Lighting corrected, shadow rotation errors sorted, alpha sorted, clouds and highlights corrected. Nailed it. I'm (on the visual side) done  8)
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-27-at-08.33.19.png)
Title: Re: Strata Nova
Post by: Derron on April 27, 2019, 09:33:57
@ lighting
Maybe decrease "glossiness" a bit - they look shiny as new plastic balls :)


@ alpha
if it was faster you could render the balls twice: once with alpha 0.5 and a radius of "radius-1" and on top with the normal radius. The "alpha one" does not necessarily need lights or so.

But I am not sure if it is faster or not.



As said ... back to gameplay.

ideas for you:

Rebellism and satisfaction:
Satisfaction depends on hunger and other needs (maybe doing too much war in a "peaceful race" decreases satisfaction).  Once satisfaction goes below a critical value rebellism starts to grow. It cannot be stopped except for increasing satisfaction again. Once rebellism value reaches a certain value rebellism is turning into a putsch - leading to you loosing access to this planet (it belongs to a new computer player).


Rebellism and unions:
These new computer players receive a flag stating their origin: "rebels" or so. Rebel controlled planets might form a union (two computer players become one then!).


Trading and Pirates:
You have ressources on your planets. Maybe introduce pirate traders (some ships you can click on) to buy ressources? Of course pirates tend to fly around, land on planets ... and "harvest" (aka steal) small amount of ressources before they continue flying to the next planet. Either make pirates invulnerable (they pay the people at the planetary defense to "not see" them) or make them hard to hit for your defense systems (only X percent chance to hit them). Hit ships means "your ressources". Hit ships also means that they need to respawn a little later ("now + randomTime(10000ms, 25000ms)").


Techtree:
Maybe invent some tech tree which requires knowledge of multiple races. You can access knowledge by:
- diplomacy (diplomacy needs some dropdowns of what you request and what you offer ... or vice versa)
- capturing planets (X percent chance to "learn something from them")
- pirates (trading for huge amount of ressources)
- spies (belongs to diplomacy too)

That way a single race could not tech to the top without interferencing with other races.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 27, 2019, 11:38:24
Quote@ lighting
Maybe decrease "glossiness" a bit - they look shiny as new plastic balls :)
sorted. 'gloss' now modified with the cloud layer, so it breaks things up a bit

Quote@ alpha
if it was faster you could render the balls twice: once with alpha 0.5 and a radius of "radius-1" and on top with the normal radius. The "alpha one" does not necessarily need lights or so.
Nah, just all handled with the single pass shader

Next up will be travel from one planet to another - just the ship, no modifiers, etc
Title: Re: Strata Nova
Post by: iWasAdam on April 28, 2019, 11:55:17
planet information and UI
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-28-at-11.53.44.png)
Title: Re: Strata Nova
Post by: iWasAdam on April 29, 2019, 10:49:18
how about some rock?  :o
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-29-at-10.47.55.png)
Title: Re: Strata Nova
Post by: Derron on April 29, 2019, 11:31:16
Thought about little decorative asteroids or asteroid belts too.


if you plan to have some "NPC ships" then you could have ships flying from planet to planet - and some harvesters flying to asteroids to "mine there".

BUT ... I think it might introduce way too much distraction for a "planet centric" game play. It depends on how "fast paced" stuff is. If it is a slow-paced real-time-strategy thing then it should work - if it is a fast-paced one then every additional "moving object" might get misinterpreted as attacking ship in the first glance.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 29, 2019, 14:28:04
new planet code:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-29-at-14.17.41.png)
and rock code:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-29-at-14.19.56.png)

These are both using the same shader with different input settings!
The main thing that wasn't working was the rotation of planets - this is now fixed :)
rock can also rotate in 3d with specular and highlighting fully operational.
Remember. No 3d was hurt in this process!

It also means that with a few different input, your smooth planets can be properly displacement mapped!
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-29-at-14.26.19.png)
Title: Re: Strata Nova
Post by: Derron on April 29, 2019, 14:44:40
While it is for sure cool - remember your glossiness - except you want to melt the planets into gold, silver or bronze medals :p


Do not forget to NOT use the displacement for the clouds (but some kind of "radius + x" for its mapping).


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 29, 2019, 14:47:17
shine is configurable. here is the last image without shine:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-29-at-14.46.23.png)
Title: Re: Strata Nova
Post by: Derron on April 29, 2019, 14:55:41
Make it brownish - and add some dark brown "splashes" on it - done is your space cookie ;-)


As much as you enjoy GFX stuff: continue with the game play  8)


bye
Ron
Title: Re: Strata Nova
Post by: Steve Elliott on April 29, 2019, 14:58:10
Quote
shine is configurable. here is the last image without shine:

Much more realistic than your metal cannon balls.
Title: Re: Strata Nova
Post by: iWasAdam on April 30, 2019, 08:20:43
I told you before: "Don't mention my shiny balls"  :P

ok. I'm now starting to add all the shaders code back into the main system and rewrite as needed to correct:
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-30-at-08.12.28.png)

thing to look out for.
1. the lighting on the planets is now completely correct - nothing is being faked, planets in front of the sun will appear backlit, etc
2. all the planets correctly rotate along with cloud formations - each has a different rotation
3. when the angle of view is changed, the planets will properly rotate on their axis along with lighting and rotation!
4. view zoom can be completely adjusted, the background star system will also scale as it moves

So what we have is a nice solar system demonstration in 2d, but looks and behaves like 3d!
Title: Re: Strata Nova
Post by: Derron on April 30, 2019, 09:18:28
There is nothing "completely unlit" if there are emissive or reflective elements around it.

I know: when in space there should be no "gray areas", things are either black or fully lit.


Not directly for planets:
https://starchild.gsfc.nasa.gov/docs/StarChild/questions/question52.html


Edit: Yet you need to keep something in mind: playability.
It does not help if the space looks realistic but you cannot distinguish the planets from the background (too many distracting stars or nearly unlit planets). Planets can become brighter in our "gamified world" because of all the light pollution of the population living on the planet.

The background with the nebulaes might look cool - nonetheless I would think it needs more "black" so the planets pop out better - else the purplish nebulae is distracting. Again to note: this might look so colorful in "real world" (never been there ;-)) but for gaming aspects we should focus on "readability".
This is a minor thing (easy to adjust) and can wait until the hud and flying object setup has settled and we know how it would look "in game".



bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on April 30, 2019, 14:47:39
yep - all good points. I had been thinking about the definition of planets vs backgrounds, etc.
Here's a first attempt with the background darkened and the planets with more color, so they stand out more :)
(https://vjointeractive.files.wordpress.com/2019/04/screenshot-2019-04-30-at-14.45.35.png)
Title: Re: Strata Nova
Post by: iWasAdam on May 02, 2019, 11:26:46
Still minor tinkering - I've added a slight halo effect to the planets now which sort of simulate an atmosphere:
(https://vjointeractive.files.wordpress.com/2019/05/screenshot-2019-05-02-at-11.21.16.png)

it's sorta subtle, but now makes the planets 'pop' a bit on dark backgrounds to help playablity
Title: Re: Strata Nova
Post by: Derron on May 02, 2019, 11:48:22
I was on my way to propose "halo" too - for the exact same reason: atmosphere (if it has one) and to ease distinguishing them from the background / popping out


Looks sweet.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on May 04, 2019, 08:21:56
hehehehe.
Been a bit busy, hence no recent update...

ok. starting to slowly pull together the UI:
(https://vjointeractive.files.wordpress.com/2019/05/screenshot-2019-05-04-at-08.15.41.png)

Here's a planet with 2 'moons'. The planet is in the background with the first planet and then the second. We can also view the first planet
(https://vjointeractive.files.wordpress.com/2019/05/screenshot-2019-05-04-at-08.19.11.png)

In both examples you can see that I've added some 'night lights'

I've also made the planets much brighter in their appearance to make them more visual

Title: Re: Strata Nova
Post by: Derron on May 04, 2019, 10:34:44
How are the nightlights rendered?
the "Xerxies" with the selection-background (center right) shows some non-anti-aliased outline pixels - and two planets below the planet has white "pixel fireflies" (as if you render them via draw commands - not directly as a texture which would "scale down" with the scaling commands).

The textures of the big planets are "blockish" - going to the bottom/top of the planets you can see the warping of your "make it look like a 3d planet"-algorithm.

Dunno how to avoid that though.



@ hud
Layout might be good, design is a bit "dull" for now. Maybe orient a bit more to the LCARS design of Star Trek?
But maybe its just the font which makes it look so ... "prototype" ;-)



Nice to see you did not loose interest yet - not nice to see you are still focusing on GFX instead of gameplay  :-*


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on May 04, 2019, 12:13:04
yep all the images are shader based, so the initial images are fed into the shader and it does the rest. I've added a bit more blur to the light - maybe I should increase the resolution a bit. but it's at 1024x512 at the moment...

Yep, the hud is still work in progress, behind the scenes I've been doing some odd optimising of the planet locations so the internal 3d systems can be fed directly to the ships and then back to the display. got the initla code working this morning  8)

This means that the planets are sitting in a 3d world which can be quickly checked now :)
Title: Re: Strata Nova
Post by: Derron on May 04, 2019, 12:59:56
Depending on how you create the planet textures you might create a high res one - scale it down and use the scaled one for "normal display" and the highres for the zoomed ones. Kind of "mipmapping".


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on May 04, 2019, 14:36:28
As far as I am aware, mipmapping is already turned on and maps auto created.
What I have got is a low res version of the map for general dev and hires versions for the final project...

NEWS:
Just created a 'ship' at a planet position and moon position. these were then displayed at the correct positions in view space. so the internal 3d system basically works. Next up is making the ships move...

and here's the code to transform 3d space into 2d view space:

local px:float = planet[0].CenterX
local py:float = planet[0].CenterY
px += planet[plnt].X * scale
py += (planet[plnt].Y * scale * _eyeY) + (planet[plnt].Z * scale * eyeY1)

Title: Re: Strata Nova
Post by: iWasAdam on May 05, 2019, 13:57:53
and... I'm not done  ;D

I've removed the pseudo clouds and replaced them with procedural ones so there is no cloud texture it's all calculated. the new clouds rotate, have density and also move... so weather patterns, and theve got color and other stuff thrown in as well: :o

Her's a planet with two moons. You can really see the 'blue/green' clouds on the first moon (also shown with high resolution planet textures) yum yum yum!
(https://vjointeractive.files.wordpress.com/2019/05/screenshot-2019-05-05-at-13.53.53.png)
Title: Re: Strata Nova
Post by: Steve Elliott on May 05, 2019, 14:35:20
Much smoother visuals.   8)

The 'E' character needs sorting though.
Title: Re: Strata Nova
Post by: Derron on May 05, 2019, 15:54:15
Maybe IWasAdam is fan of Joe Biden ;-)


@ clouds
they look like a marble-texture - It's possible but looks a bit "melted with the ground" (at least on static images).
Maybe more perlin noise?
Look at google images for "earth clouds" and you will see a bit more.

That you can color them (and other things) is surely useful - think of a sulfur planet or so - or mars + clouds.


Once you do procedural clouds - the planets could be procedural too ("ocean + countryside + mountains + forests + ..."). Stuff can become scientific - but also it is something you might enjoy coding.
Hope you do not plan to allow a "planetside view" (land with your ship and explore ...). No need to code No Man's Sky.



bye
Ron
Title: Re: Strata Nova
Post by: Steve Elliott on May 05, 2019, 16:05:53
Quote
Maybe more perlin noise?

+1
Yes I like the smoother visuals, but some noise to break up the clouds a little.
Title: Re: Strata Nova
Post by: iWasAdam on May 06, 2019, 07:53:08
mmm, think I should be able to add some noise in there :)

And nope, not going down the 'no mans sky' rabbit hole with terrain generation.

Been working on a little math problem:
for any 3d line xyz0 to xyz1. move a certain Length along the line.
Solved it:
(https://vjointeractive.files.wordpress.com/2019/05/screenshot-2019-05-06-at-07.45.02.png)
Here showing two lines (in yellow), with the exact same lengths being marked along each line (orange squares). This is in 2d being projected back into 2d so there are minor jitters. but it works.

This means the next step - ships and movements can begin :)
Title: Re: Strata Nova
Post by: iWasAdam on May 07, 2019, 10:49:31
ok, so lets turn attention to the UI - which was never that good looking...
how about:  ;D
(https://vjointeractive.files.wordpress.com/2019/05/screenshot-2019-05-07-at-10.42.25.png)

And there is even a freighter marked. it goes from a source to a destination loads and unloads! destination can be other things like ships - for expansion, etc
Title: Re: Strata Nova
Post by: Derron on May 07, 2019, 11:22:41
Is this 1:1 resolution or scaled down?

I assume on FHD (or UHD) screens the menu might look a bit ... overwhelming (aka "too big"). Of course this depends on whether the GUI is relatively sized or absolutely.

Designwise something is still missing - it looks rectangl-ish/blockish and is full of opacque colors (single tone). This makes it look "clear" and "distinctable" but ... dunno how to describe it (and how to do better while staying with the basic design idea) but it looks like a status screen - maybe it needs some interactive stuff in it?

Is it visible all the time or only when selecting stuff?

I think it might work if it is only shown that way in status/sub screens (trading, showing planetary stats, ...) while during "main game" it is hidden and only some icons or a side-bar (with minimap etc) is presented.


bye
Ron
Title: Re: Strata Nova
Post by: iWasAdam on May 07, 2019, 11:53:25
Thats a really interesting observation about the UI.

Here's what I've done:
(https://vjointeractive.files.wordpress.com/2019/05/strata-ui.gif)

basically the UI hides to the side (showing a little bit)
when you go into the area the button slide out and are highlighted as you hover over them :)
Title: Re: Strata Nova
Post by: iWasAdam on May 07, 2019, 15:32:18
if we have solar systems - which could be taken over. then we need some form of map system (with tutorial systems, etc)

Say 'Hello' to the initial Stellar Cartography (yep, no 3d was hurt)
(https://vjointeractive.files.wordpress.com/2019/05/stratamap.gif)