Community Game Project built in modules on a flowchart 2

Community Forums/Common Room/Community Game Project built in modules on a flowchart 2

skidracer(Posted April) [#1]
Continued from here.


Mainsworthy(Posted April) [#2]
that looks nice Adam. seems skidracer joined in too :)


Mainsworthy(Posted April) [#3]
I now know a few things, so I will concentrate on using clear and commented code, & tidyup what Ive done , I really didn't know what I was doing when I started, but I can see structure is better.


AdamStrange(Posted May) [#4]
ok. i'm looking into the systems, their makeup, etc.
i've got a list of basic things to do, etc.

But... There is a text version of Elite. I thought I would go over this and extract stuff from it. Hopefully being able to integrate it all later.

Stay tuned


Mainsworthy(Posted May) [#5]
any chance of a link to that text version, I would be interested too , if its available to people to see?

I'm tunedin Adam, keep going beyond


AdamStrange(Posted May) [#6]
ok. first thing is a planet/system namer.

initially based on the elite code. but then scrapped, tweaked and shortened


I'll keep working at this as asteroids need definitions that are different form planets, etc

but you now have a basic naming system...

here's the link to Ian Bells page with the elite text source
http://www.iancgbell.clara.net/elite/text/


Mainsworthy(Posted May) [#7]
Adam you are very professional in your work, thanks for the link,


AdamStrange(Posted May) [#8]
ok. working my through things and thinking how all this is to be incorporated.

basically generate system - done
next generate name and system information - being done

heres the next region of the info code:


basically I am adding the elite basic concepts. government type, economy and tech level
These are all based from the given seed, so will be unique, so we don't need to store the data, just the seeds. and we are generating them, so we only need an initial seed to kick off everything.


AdamStrange(Posted May) [#9]
and lastly we have the inhabitants


I had to take quite a few liberties with the last bit. you can see some of the original code and the new versions - just using some dirty mod functions. but it works brilliantly.
I also added the ability to use different length inhabitants text, so it gives wider variations.


Mainsworthy(Posted May) [#10]


I thought you may like to see what Ive been doing :)

its not elite , but its good fun

https://numbergamer8.itch.io/miniatures-game-tool


Mainsworthy(Posted May) [#11]
I hope you post your progress soon, I can only guess your making a proper job of it, I know how a game like elite deserves proper detail .


Mainsworthy(Posted May) [#12]
I wasn't suggesting you post code, that can be a long job, just what your upto.


Mainsworthy(Posted May) [#13]
Ok, Ive started converting Rogue3 to Monkey2, I'm not going to do much with the code except move it across, so all the globals etc nwill still be there, I hope I don't run into to much compiler headjams, still noob at monkey, so thought it would help crossover.


Mainsworthy(Posted May) [#14]




ok I did a port from blitzmax to monkey2 of rogue3 elite type game, turn based, I had to do a few little adjustments, but its virtualy the same

https://numbergamer8.itch.io/rogue-three-privateer


AdamStrange(Posted May) [#15]
yay. methods and no gotos....

I'm back!


Mainsworthy(Posted May) [#16]
missed your posts, looking forward to seeing those moons orbiting on the nav map ::)


Blitzplotter(Posted May) [#17]
Great to see how this project is progressing, great work ;)


AdamStrange(Posted May) [#18]
sooo. I've been decoding goatsoup. which is the planet description system for the original elite. wan't nice and needed all sorts of odd things added etc to get it usable.

it gives some great answers...


AdamStrange(Posted May) [#19]
the last part is the basis for trading.
wach planet will have a trading market with prices, etc. using this we should be able to build on top of it.


Mainsworthy(Posted May) [#20]
Great stuff :) I just ran it, very cool to have it generate this


AdamStrange(Posted May) [#21]
all this will be fed back into the system/planet drawing, so we finally have complete systems with economies. using all the info we can then further refine the looks, etc.
E.G.
asteroids will have very different things from planets
we can further narrow this down say moons are more likely to have mineral and mining...

But, working on basic markets to form the basis for trading.

one very interesting thing (from a monkey programming point) is how to define data with the const.

We can use this to form the basics for speech later on...


Mainsworthy(Posted May) [#22]
glad you like it BP :) its Adams project, I'm just taking it all in


AdamStrange(Posted May) [#23]
ok. Here's the list of items that can be bought and sold:
"Food", "Textiles", "Isotopes", "Androids", "Water",
"Slaves", "Alcohol", "Science Equipment", "Drive Parts",
"Narcotics", "Containers", "Tech Parts", "Machinery",
"Alloys", "Weapons", "Biological Equipment", "Minerals",
"Gold", "Platinum", "Gem-Stones", "Alien Tech"

in essence I have covered most things. So we can use this as a starting point.
E.G. biological + weapons would make a biological weapon, but you would need research i suppose?

You get the idea.

Now I have bas prices and a basic market system. just the display, not the actual buying/selling.

What we need now is a place to store all this.
My thoughts are this:

every unit (ship, planet, etc) has a hold and a list of the items in the hold.
So a planet would have a big hold (or maybe not). a ship would have a small hold.
maybe there would be different holds for different cargos.
So, if you were a smuggler there would be a normal hold and a secret one.

Now.
Lets assume that for any sized hold, you need a drive to transport it. the bigger/heavier the good, the bigger the drive, or the slower it would move.

and of course if you needed weapons, cloaking, etc that would also need more power.

So... How about a ship design part. You have off the shelf basic parts to build your ship. these can be upgraded, or a new ship design built, or modified.
That would make all the nasty stuff simple (like how big a hold is, what drive capability, etc.

we could use a grid, and you just drop the ship bits onto the grid. Looking into the future, this could also be done in 3d!
But what are people thoughts on this?


Mainsworthy(Posted May) [#24]
The grid idea seems good, but Ive played these games before and you need to have things in the right part of the grid eg:forward lasers top, rear at the bottom. so when you do combat you can take damage in the right location,


xlsior(Posted May) [#25]
in essence I have covered most things. So we can use this as a starting point.


you may want to consider 'agricultural equipment', 'electronics/luxury items', and perhaps something dangerous like 'toxic waste' or 'radioactive materials'

(In Elite, 'slaves' will turn into 'fertilizer' if you forgot to add life support to your cargo bays)


Mainsworthy(Posted May) [#26]
:)

also to keep things simple, instead of cargo having different effects, you could use more of the grid for heavy cargo etc..

you could use total energy from the engines and use it for propultion, shieds,lasers, etc... so you split your power to suit whats going on.

also consider a banking system, so when your ships gets blasted you can buy a new one.


Mainsworthy(Posted May) [#27]
also you want some cargo as passengers


Mainsworthy(Posted May) [#28]
fuel could also take cargo space


Mainsworthy(Posted May) [#29]
escape pod is cargo


Mainsworthy(Posted May) [#30]
you want to be able to scavenge cargo, and mine for it.


AdamStrange(Posted May) [#31]
we're getting ahead of things, but all brilliant suggestions. we need to start small and then work out from there ;)

I'm just doing some icons for the first go...


AdamStrange(Posted May) [#32]
code time. This one is incredibly useful



you will need this graphic:


it's a 32x32 bitmap font. you can load it into my fontsprite editor to completely mess with it if you want.

But the code is the important bit. it sets up a basic page, but also has the base class for the font drawing.

Feed it the png file, turn OFF texture filtering in the OnRender and then draw your character. you can't rotate, but you can scale, or resize depending on the data you give the DrawChar method.

Let me know if there are any issues with this one... It's going to form the backbone of what comes next...


Mainsworthy(Posted May) [#33]
Caught signal:Memory access violation

Just tried running it, but got above error, try putting all code together in one block and posting what you have got and I will have another go.


Mainsworthy(Posted May) [#34]
its ok, just did the windows10 update that reset my save folder so assets was not there, just resaved correct path, and is running


AdamStrange(Posted May) [#35]
no probs...
The code above allows you to deal with bitmap font sprites.

Next code will bring palettes into the mix and finally the map code will meld all three things together....


AdamStrange(Posted May) [#36]
couple of pics

The first one shows a palette on the left, and on the right the new palette loader in place just showing that it works

Next up is the map loader:


This shows the palette, plus a grey diamond which comes from the font.
The bottom 'ships' come directly from the map, and consist of a background 'blueprint' outline of the ships. with a second layer showing the grid cells that are available to drop cargo slots, drive units, scanners, etc.

Using this we can create the ships in the map editor.
there is another thing that I hadn't considered, but... Because we have the outline separate, we could use the colour information to show damage or engine overheating....


and onto the slots...


Here we can see all the ship slots being filled.
From the top we have:
Scanner
Jumpdrive
laser, targeting, laser
cargo, cargo, cargo
cargo, cargo, cargo, cargo, cargo
stardrive, power, stardride, power, stardrive

each slot item can be upgraded, so there would be more power, etc. but that would cost.
I suppose you could start with a simple ship, or base blueprint and credit, or credit balance.
New blueprints could be found or bought etc


Mainsworthy(Posted May) [#37]


https://numbergamer8.itch.io/rogue-three-privateer

I did a trade stocks on rogue3, not anything like yours Adam, I just was passing time.

YOUR STUFF ABOVE LOOKS REALLY GOOD NOW ADAM


AdamStrange(Posted May) [#38]
here's the code for palette loading:


and the new map loading code with modified imagefont added



Mainsworthy(Posted May) [#39]
can you put all the code in one code block? I got an identifier missing, but I'm guessing your showing the code for review, but Id still like a full codebox, I keep rebuilding, and Ive got lots of apps Ive been playing with, I renamed them stupid things, and losing track, so a codeblock would be nice.


AdamStrange(Posted May) [#40]
what I will do is strip all the code and zip it and put it up for downloading ;)


Mainsworthy(Posted May) [#41]
It looks great Adam, your doing elite justice, I cant wait to play it :)


therevills(Posted May) [#42]
what I will do is strip all the code and zip it and put it up for downloading ;)


What about uploading it somewhere like GitHub?


AdamStrange(Posted May) [#43]
yep - good idea. i'll look into that one.

ok, here's something very interesting.


this is a shot (from the map editor) of another layer (0 is the outline, 1 is the available slots)
as you can previously see, there are many ships packed into a single layer, so we need a way to decide each ships start and end, and a name would be good.
so....
using another layer each line becomes data!
and the format of each line is x,y,w,h,name(12 chars)
so...
we can now use the map to store data as well as other suff if we want...


AdamStrange(Posted May) [#44]
ok. taking all the above I've now added an image of a pilot (just a panel), some text and a quick control showing the current ship and got this:


I think on the right should be the list of ship components to drag and drop


AdamStrange(Posted May) [#45]
and another shot of the UI before mouse interaction has been added to the controls


the basic ui colour will be 'Pine' and 'Aqua' with Sky being the default button and UI acknowledgement.

I can describe what has been done, if wanted?

apart from the font, and four images (the pilot, and three buttons) there is nothing added apart from a few custom controls

You can see that the pilot is faded so the background shows through
There is a fade panel and slide panel being used for the UI at the bottom.

I should add that this is completely size aware. if you rescale, the UI will do the same...


Mainsworthy(Posted May) [#46]
Adam, ooh its getting good, just carry on doing more,


Mainsworthy(Posted May) [#47]


https://numbergamer8.itch.io/rogue-three-privateer

I did a trade stocks on rogue3, added a ship dealer & updated graphics,

Its nothing like Adams , but its in the same type of game. Adams is a lesson on to to do it right .


AdamStrange(Posted May) [#48]
your's is a playable game, all my stuff is bits and pieces that need connecting...

the code shows how to do it all with simple concepts (hopefully)

Here's the latest. I got slightly bored and added a shader to the background:


I've also tweeted the text colours and selections. Cloak Generator is currently selected, the mouse is over the scanner. so you always get feedback.

The odd thing going on i the background (faded green blocks) is the shader. It is basically being a faux computer, and printing random alien computer text. it does nothing, but just makes it look a bit pretty, and is constantly updating


Mainsworthy(Posted May) [#49]
now the faux computer is a genius addition, that's super super cool


Mainsworthy(Posted May) [#50]




https://numbergamer8.itch.io/rogue-three-privateer

Ive added ship upgrades aswell as ship sales, missile bays & cargo bays can be increased, you can buy better ships with better engines, you can buy missiles one at a time, you can fire in 4 directions or just 1,2, or 3 directions, hull strength can be increased with bigger ship purchases

I don't want to distract you Adam, maybe we can get ideas from the two apps, and improve both . its a similar app so may fit in the thread, just thought you would like to see what I'm doing with my time, but Adam your App is far far more than mine


AdamStrange(Posted May) [#51]
Quick peek at the source - indenting - there i've said it again.

suggest:
removing white outline from stars
red selection around mission track leak over the right, give missions a bit more room


Mainsworthy(Posted May) [#52]
I just ported the code, its far from perfect for a class structure, I suppose I should copy all the globals to property. I did not follow indenting or anything, I'm supprised a blitzmax game is running in monkey2.

interesting idea to remove white box, but I like the box, but I will give it a look and try.

I don't know why I'm making it better, It seems like fun, I don't want to distract your App as yours is miles more than mine, mine is a bit of fun.


AdamStrange(Posted May) [#53]
Yep, did you do much to get the blitz code working in monkey2?

I'm just working on the placing of the units into the ship. I've decided to implement a bit more strategy:
Anything that needs a powerplant (stardrive, jump drive, scanner, targeting,laser auto shield cloak generator) will need to be near a poerplant
...
so a power plant can feed power to 4 items max

this means some logic to display flashing power generators next to things that need them.

Not very nice, but we only need this logic in the actual ui stuff. Once it's been set it can be ignored.

Although... if looking to the future. Lets assume there is going to be some form of combat and damage. if a power plant goes offline, then any things near it would also go offline.
E.G. lasers and engines would stop if they were connected. which would mean you become a sitting duck... QUACK!


AdamStrange(Posted May) [#54]
heres a quick shot of the main ui finally in operation:


so you can see there are 3 powerplants. the stardride on the right has a flashing powerplant to the left and the scanner above is greyed out. this shows that a power plant is needed to activate the scanner.

It also means that each stardrive has 2 powerplants, so if (for whatever reason) one is down, the drive will still keep functioning.

This gives an interesting dynamic, in that the DeltaFang is a ship design, how you populate the interior of the ship is up to you. you might want lots of drives, or lots of cargo space, or a jump drive. it would depend on what you want to do...

Thinking about future stuff - there is no restriction on what goes where apart from power being next to things that require it. If we moved into 3d and the engines were at the front, then there could be some for of logic that would resolve this. say the engines could be on the top or the bottom or the basic shape?

So... that would mean that things like cargo, engines, lasers, targeting, etc would alter the basic profile of the ship. and further you could then have a livery for the ship as well...


Mainsworthy(Posted May) [#55]
My App now has a banking system for loans and interest payments,you get better deals if you pay early , and save and load functions. the monkey2 coversion was easy but would not like to do it again, but I learned things like Rnd(1,6) is not the same as Max Rand(1,6) .

Adam your App is like game candy, I want it so bad , I think you should put a propery with the interior item 1,2,3,or 4. for front back left and right, I know from experience even in 2D you get hit from different sides, you don't have to do anything with it, just have the number there with the item, when in combat you have to know if your fireing front or if your left shield is being hit, trust me on this, Ive seen great games be binned for this reason.


AdamStrange(Posted May) [#56]
interesting thought about the left/right/up/down.

But... when the ship rotates you would have to take that into account.

So, I thought about it with targeting. The lasers point forward, Unless you have targeting added, then you have turrets/lasers that will target.

Shields are per ship, so you only need one - possibly expensive? maybe it covers a certain range of squares? so shield of 1 has less coverage that shield of 5. or made that is hit count? not really thought about that one.

in essence I'm thinking of a ship as a single point with rotation. from the rotation and targeting you can determine all the rest. I'm trying to simplify thing a bit and hopefully do all the nasty stuff without the user knowing <eeek!>


Mainsworthy(Posted May) [#57]
shields , shielding items nearby is good enough to fly, it could even work out much better, that is a great idea


AdamStrange(Posted May) [#58]
mmm, ok, working on universe system now. What I want is to be able to zoom in and out.

we've already got the system positions and planets. so it is a reworking of the code.

What I have done so far is write a shader for the stars. this can be fed with x,y positions so they can move when the mouse moves.

The universe itself has now got a the individual systems picked out in their colours. This both adds to the universe effect, but means once I've sorted out the zooming, the proper colours will be applied.

I'm using additive blendmode to give a more stelar appearance:


as you can see it's now very colourful...

You can also notice that the centerof the universe is much brighter with a more packed set of systems to explore


Mainsworthy(Posted May) [#59]
I can see what its doing, and you can do things I never even thought of or tried in any programing,


AdamStrange(Posted May) [#60]
nah, stick with me and I'll show you the stars...

In my opinion there are some serious things missing from Monkey2 in the graphics department. just a few, most people won't miss or use, but they are incredible useful.
E.G. being able to feed a shader information and being able to draw an image quad in any position with different corners.

That's the reason I cont post you the code - it won't compile without a few additions. :/

ok. I tweeted and tweeted until I got it looking the sort of way I think it should. I had to increase the systems from 256 to 512, so there is a lot to explore.
I've also taken the auto system naming and integrated it

Taking all of that with the zooming and star field shaders gives us this:


This is a zoomed version of the above map, showing all systems with names.
The hex is the flat position on the map with no height. The line going from this, goes to the actual system location - if you look really hard you can see blurred systems at these locations.

Some of the systems have colours. These are the 7 prime systems and galactic centre.

To the bottom right the Nannar system has the mouse over it and is pulsing.

I need to add the ability to show the different factions now...


Derron(Posted May) [#61]
>ok. I tweeted and tweeted until I got it looking the sort of way I think it should

tweaked ? ;-p


@ Powerplant
You might think of different levels - increasing amount of powerable slots (with the danger fo running one single high level powerplant without "backup" ...).

Cargo holds should need power plant connection once you store living cargo (slaves, animals, passengers).

Another interesting aspect might be "water" for certain life forms... aquarium/fish tank - maybe for really rare and illegal "sex slaves" or so (they are so ... wet ... and fishy) - or for some more serious goods :-)


Derron(Posted May) [#62]
>ok. I tweeted and tweeted until I got it looking the sort of way I think it should

tweaked ? ;-p


@ Powerplant
You might think of different levels - increasing amount of powerable slots (with the danger fo running one single high level powerplant without "backup" ...).

Cargo holds should need power plant connection once you store living cargo (slaves, animals, passengers).

Another interesting aspect might be "water" for certain life forms... aquarium/fish tank - maybe for really rare and illegal "sex slaves" or so (they are so ... wet ... and fishy) - or for some more serious goods :-)



@ zoomed map
It is a bit "too much" ... it is exposing too much. Maybe remove planet names if your mouse / selection is far away. So the further away something is, the less visible it gets.
As you need them all for "target" selection you might have a "min visibility alpha value" ?.



bye
Ron


AdamStrange(Posted May) [#63]
Mouse near name appears that is a brilliant suggestion Derron.

The shown map was just really showing all the systems, so you get a flavour of what I am doing. In practice there wouldn't be that many visible at once.


Mainsworthy(Posted May) [#64]




Ive added to Rogue 3 a big Black Market trade computer for smuggling and Police checks. I hope I'm giving you ideas on your app Adam , its my way of contributing.

yes mouse near names is a good idea, you could display distance from you too


Mainsworthy(Posted May) [#65]
Ive ported the Monkey2 code back to blitzmax, so now got both upto date versions included, 64bit & 32bit, and MacOSX 32bit


Mainsworthy(Posted May) [#66]
do you know why your game is far better than mine, apart from it having some nice features, its because your doing it the right way, and it can be used as an example of how to do it, mine is a plate of spaghetti , it works and I like it , but the source code is spaghetti :) I need to go back over your code snippets again and learn some more .


AdamStrange(Posted May) [#67]
Here's something for you to look at


What I've done is move the drawing code from the OnRender into a custom control that can be simply referenced through the page system.

Here's is the code. IT WONT compile or run as it has a few additions to make monkey do some nice things. But...
Have a look at the code, especially the New()
In essence it is a completely stand alone display of the system, with full mouse interaction - take a look at the minimal mouse commands.

Then take a look at the actual drawing with close inspection of the _alpha
It's all commented for you.



There is some very strong programming stuff going on inside to force it into a black box.

Oh and have you guessed what it is yet?
It's a stargate system!
Each system has the potential to have a stargate.
Each gate links to up to 7 other gates, and you can use them to travel around.

the image is the entire universe showing just the gates, and current gate and it's destinations


AdamStrange(Posted May) [#68]
this is a bit more cool...


again you see the stargazes, but this time there is some additional UI stuff

What's cool about it?
Well, the UI (green) part has been taken from the ship configuration page, and a page made from those parts.

Because it is now a page, we can show both pages, and voila we get a separate UI that can be used for other parts of the game at any time we need it.
This also means we can code all the UI parts as we need them and they can 'just' slot in.

There is a couple of other cool things that can happen because of this, but I'm not telling just yet...


Mainsworthy(Posted May) [#69]
I'm a bit tired right now, so I will get into it tomorrow( don't think I don't want to read it), thanks for posting the stuff,

the stargate may be buried under the desert on some worlds , you may need a worm hole :)

Its very good programing the way you can scale, add buttons, I tend to do buttons as I need them - bad programing ,


AdamStrange(Posted May) [#70]
Missions...... ooooh

ok. I'm not going to talk about what. E.G. pickup passenger, collect cargo, etc. but the structure.

WHAT? I hear you cry.
OK, lets assume a mission can be classed from easy (0) to hard(4) <- we can decide what the missions are later.

lets say that missions can be completed in any order
BUT
missions are grouped into 4, so... You need to compete all four missions in a group before the next set of 4 can be attempted.

So far, so simple
that means we car draw them on a graph sort of like this:


But (visually) this is not that appealing. how about some branches?


this is still the same, but we have some branches. we could further say, that you can't do the branch mission till you've completed it's root.

This gives us a much more interesting set of choices? thoughts?

Note we haven't got any mission details, just a progression tree
How could we code it?

the mission level is easy int level=Rnd(5)
we could also decide if a mission was branched or not

we could random that too - lets assume we have a mission string "20312413" of mission levels, we could add a - if the mission was connected or a < if it was a branch
E.G.
2-0-3-1-2-4-1-3-
would be

and
2<0-3-1-2-4<1-3-
would be


so... Here's the code ass wrapped up in a class


it's got a few tiny extras line total length and a few checks added, but still really simple?


Mainsworthy(Posted May) [#71]
Maybe, you could have a mission completed if you complete 3 of the 4, so you could choose which one you don't want to do.

and maybe you may have to repeat a mission if you fail one of the other 4.

also an automatic win if you complete the hardest.

I'm just bouncing off ideas around the 4 mission choices.


Derron(Posted May) [#72]
Yes "alternatives" should be an option.

so the drawing would be like this


   2a
1<  >3-4-5...
   2b


And no, a stringified version will get sooner or later way more complex. Trust me - especially when you want to introduce "probabilities" of sub-missions (do they happen to be done or not). You will use brackets then.


In my game I use similar thing for "news chains" and each news gets multiple variants of triggers - trigger a single follow up news, or choose out of a group of news each with their own probability. The follow up news then trigger their own follow ups - and finally they might trigger all the same end news. Of course this means you cannot "reuse" a child mission with a different config then. Hmm. So also not a super-solution (but it fitted into what I needed for my game ;-)). Maybe it helps finding the perfect solution for _this_ game.


bye
Ron


AdamStrange(Posted May) [#73]
yep, agreed about the 'stringified' stuff. It was a good was to show how it operates - the visuals are very clear, but to code was not so simple.

there is another issues which is present: the systems itself. the make up will have a direct influence on the type of missions and therefore the construction of the mission tree. ;/

But I thought this was a good way to introduce things.
I think next would be to move from strings into something that can be better parsed with more data available


Derron(Posted May) [#74]
You could of course still serialize things.

a) give each mission a unique ID (or just "number them")
b) use a delimiter for mission configuration: "|"
c) use a delimiter for "mission data definition" and "mission chains": "||"
d) use ";" as delimiter for configuration entries
e) use brackets "()" to enclose groups

(of course you could use the same delimiter for everything - and then check if opened-tags equals to closed tags)

Result would be something like this:
mission1(difficultyMin,0.7,difficultyMax,1.2)|mission2a()|mission2b()|mission3 ...
||mission1(followup(mission2a,nonoptional+showintro),followup(mission2b))|mission2a(followup(mission3))||mission2b(followup(mission3)) ...


But of course nowerdays there is no need to have such complex strings, you would then just use some XML or so. I think you already knew this and just wanted some simple string like "133445645654" telling what missions will come in which order. If so, sorry for adding some fuss to your thread :-)


bye
Ron


Mainsworthy(Posted May) [#75]
we like fuss, cant wait for a playable candy version,


Mainsworthy(Posted May) [#76]


I did a bit of Adam type graphics update :), I would never of done this without Adams Input, I do know the grill isn't aligned with the engine power etc.. but its better than before


Mainsworthy(Posted May) [#77]


all programing finished so I finished the graphics, I'm just posting to show how I'm improving with gfx, and to keep this thread active, I'm looking forward to your next post Adam.


AdamStrange(Posted May) [#78]
had the weekend off, so nothing quite new at the moment, but have been going over old elite stuff to see how it operated...


AdamStrange(Posted May) [#79]
mmm. looking at elite and how it operates. the 3d is a big part of things.
so... Using the low poly editor I did a quick test with the deltafang:


and the 3d version with a quick planet


What I did was to take the deltafang shape and add the cell positions. these need to be half height (so that also gives a defined size and cargo allocation).
I then tweaked the design keeping the interior space true. Added some base engines and details and some base colors.

This is just a pure flat shaded lowly model. but does seem to have a sort power to the way it looks?

Although there is a ver sophisticated 3d module being developed for monkey2, I could port this low poly 3d one over very quickly...


Mainsworthy(Posted May) [#80]
It was procedural random universe I think, the music was mesmerising when you travelled in space. and you could choose a carer path army pirate etc... I played elite frontier 2, not the bbc micro version, but the bbc micro version ported to PC is free if you join elite dangerous web site(you don't have to buy anything) I thought frontier 2 was lots better, Id play the bbc version, except I like turn-based


Mainsworthy(Posted May) [#81]
that low poly looks perfect for elite nostalgia, really looks like elite


AdamStrange(Posted May) [#82]
I've never played any space sim game apart from "no mans sky"
Here's something interesting. I lived with one of the guys who wrote the original Spectrum version of Elite...


AdamStrange(Posted May) [#83]
got the initial stuff worked out:
a vertex buffer with points,colors, normals
and an entity buffer that sets out the object vertexes

Here's the code:


You will need this as well which is the matrix.monkey2 file



Mainsworthy(Posted May) [#84]
My claim to fame is I worked with someone who had worked with clive Sinclair, I still owe him £10 :)

I will mull over this code, because I have no idea yet how you did this ship view


AdamStrange(Posted May) [#85]
the ship view is something very different - it came from my low poly 3d toddler and was put together in photoshop. But I am working on getting it into monkey2.

The code above is the first steps in doing this...


Mainsworthy(Posted May) [#86]
ahh, I thought it was a 3d view of the ship, its realy cool though,


skidracer(Posted May) [#87]
Orrery - mechanical model of the solar system that illustrates or predicts the relative positions and motions of the planets and moons.


AdamStrange(Posted May) [#88]
@Orrery already done. planets, moons, etc all move is correct orbits ;p


AdamStrange(Posted May) [#89]
minor update. got the depth sorting working and now thinking about model import!


AdamStrange(Posted May) [#90]
Very early days, but now looking promising:


This shows a single 3d cube with coloured vertexes. it is then shown twice with the second version being rotated.

It basically shows a single object that functions in 3d with proper depth working.

I've got the skeleton of code for the loader, but now need to write the converter so that it can be displayed...

I think the best way is to have each loadable 3d object a self contained 'thing/object' we can draw it with a single command then...


Mainsworthy(Posted May) [#91]
cant believe your doing modelling too.


AdamStrange(Posted May) [#92]
Heres' quick link to Rameses - my low poly modeller
https://adamstrange.itch.io/rameses



and some animated stuff it produces - hopefully we might get all of that at a later time too...




AdamStrange(Posted May) [#93]
YAY!!!!!! it works


Pic of monkey2 app with spaceship model loaded. Also showing the same ship in the 3d modeler complete with vertex colors...


AdamStrange(Posted May) [#94]
here's the normal calculations with a quick lighting test


it's not perfect, but ok for what we are trying to do


Mainsworthy(Posted May) [#95]
this is great Adam, please please make the combat turn-based.


AdamStrange(Posted May) [#96]
not got that far.
ok. how would you approach turn based?


Derron(Posted May) [#97]
step by step (uhh baby).


instead of simultaneous movements you just allow "move + action" (eg. move and then attack).

Of course fights would get a bit more tedious then - or attacks must be "more powerful" (so 2 hits destroy a ship - instead of having to shoot 200 bullets).


I think "switches" to allow realtime _or_ turn-based are not very useful as the balancing is a lot different between these two.


bye
Ron


Mainsworthy(Posted May) [#98]
fire laser Mk1(has an attack value of 40)

your health is 100,

so attack = Rnd(1,40)

attack = attack - shield

attack = attack - armor

health = health - attack

then you attack pirate.

turn = turn + 1


Mainsworthy(Posted May) [#99]
My mac was very old, I did not know you could update to sieraOS, because it was old I didn't think security wise I could go online with it, so I never looked at upgrade. I'm in the middle of upgrading now, sure was a shock I could do this,


Mainsworthy(Posted May) [#100]
I think its to old, nevermind


AdamStrange(Posted May) [#101]
what happened? what sort of mac was it - iMac, mac mini??


AdamStrange(Posted May) [#102]
@mainsworthy is there any way to contact you privately?


AdamStrange(Posted May) [#103]
basic lighting and texture import more or less working now...



AdamStrange(Posted May) [#104]
Last one for the day...


using jpg as a heightmap with lighting. I've got something interesting going on with the red colors - these are fed into the shader and the shader does the colouring, so you could have different colours, for different ships - but they all have the same 3d model with no changes!


Mainsworthy(Posted May) [#105]
your making a big impact with this! the game has gone far beyond what I imagined it would be, you could color more of the ship then when damged replace with a burning color maybe, just an idea.


AdamStrange(Posted May) [#106]
sort of creeping forward:


this shows 3 models:
planet - being sown as points
galaxy - it's a sort ball with some nasty uv mapping and a single shader. so no bitmaps are being hurt
ship - this is being shown with a default blank shader, just so you know it's there

Spent the last day sorting out incorrect uv vertex locations in the 3d package. It took some time to get everything exactly right!

So, I'm sorta ready to take the next step into how to deal with the entire display with other stuff in it. not sure about game play as this is a lot of tech work going on in the background....


AdamStrange(Posted May) [#107]
last one for the day...


very dark ship, with wireframe. so in theory we could now do a starters arcade wireframe with proper depth culling.

I'm starting to see where this could go...


Mainsworthy(Posted May) [#108]
Adam I know your doing hard work, I can see how good its going to be.


AdamStrange(Posted May) [#109]
ok. Moving on from being able to import and show models in different ways.

I'm now tinkering with the 3d UI. this is all 3d with no 2d being used


I thought bottom left for the ship. we can flash the ships outer ring red to denote a hit, and even use the orange direction objects to show where it is being hit!

The bottom right for the actual system view with planets and orbits shown

the boom main view would be for the scanner showing your location (the centre) and any nearby ships, things of interest. I've shown the orange range finder which shows the direction of the most interesting thing, but this is just a thought, it could show anything... as it is in 3d it can smoothly rotate, we can control the color/alpha, of any item as well. using scaling can also affect how things are displayed. The orange area could shrink and grow from the centre of the display

Here's a final one with the galaxy and ship added (ship not lit by lights)

thoughts?


Mainsworthy(Posted May) [#110]
I realy think it looks good, but I only like turn based combat, so if the 3D is going to be a dogfight gameplay I wont like it although some will. but if its going to be 2D then it looks something special, if you have real time combat then it will be like thousands of other games, but if you use this in a turn based setting it will stand out.


therevills(Posted May) [#111]
Great work Adam!


AdamStrange(Posted May) [#112]
thanks. I know Mark is working on a 3d module too.

@Mainsworthy I think these can be considered tech demos more than anything else. there is no game play are strategy yet in how it will operate. Theres a lot to get me head around


AdamStrange(Posted May) [#113]
I think this is what you mean...



Mainsworthy(Posted May) [#114]
Now that is ultra good,


AdamStrange(Posted May) [#115]
Sorted out the nasty OpenGL bug
working on a few new ships...


lighting now operational too.

here's my thoughts:
the occupied cells are:
- pins with ship, etc
- flat areas (4 around the space station base). if you are next to them, then you can access their things. trade, etc
- the flats with cubes and green top show something of interest - could be debris, something to collect, etc
- red pin with asteroid, something to avoid
- not shown. Red flat areas would be hazards. avoid being next to them...

Thoughts??


Mainsworthy(Posted May) [#116]
Adam, the game looks something special now, not just another shooter, it looks amazing!!!!!!


AdamStrange(Posted May) [#117]
ok. so lets assume we are now fixed to a 16x16 grid.

How would you approach the AI and movement, etc?


Mainsworthy(Posted May) [#118]
just something simple

if AIshiptogo = 1 and AIturn = 1
move()
fire()
endif

function move()
if x > enemyx+2 then x = x - 1
if y > enemyx+2 then y = y - 1
if x < enemyx-2 then x = x + 1
if y < enemyy-2 then y = y + 1
end function

function fire()
if x > enemyx-2 and x < enemyx+2 x > enemyy-2 and y < enemyy+2 then firelasser()
end function

function firelasser()
z = rand(0,laserpower)
enemy health = enemyhealth - z
end function


AdamStrange(Posted May) [#119]
it's sort of like turtle graphics, but for units?

you get a certain amount of 'commands', and then decide if you physically move, fire, or whatever?

Once all commands are done, the opponent has their go...


AdamStrange(Posted May) [#120]
Here you go...
First download to see what's been going on...

http://monkey2.monkey-x.com/forums/topic/initial-low-poly-3d-import-test/#post-8296

This has all the data and code for the 3d engine plus models and some keyboard controls


Mainsworthy(Posted May) [#121]
I just ran it, and the movement really immersed you, you have got to complete this game Adam! its bloody brilliant!


Mainsworthy(Posted May) [#122]
in fact adam, you could even scrap movement in a turn based battle, just place them on the grid, and fire at each other.


AdamStrange(Posted May) [#123]
Yep, but there would have to be some mechanism to do that and make it all fit together and work...

I like the concept of turn based. I turn, they turn.

Lets say there are buttons (onscreen) for turn left, turn right, forward, target, fire

Once you pressed a button (command) the AI moves the other player.

But. What if the ships took different lengths of time to complete an order?
E.G.
a small ship can move twice and a big ship can only move once?


Mainsworthy(Posted May) [#124]
if you think of space travel your going fast, and on a small tactical area you all may be of equal sub light speed. but if there are different speeds you give a turn a number say 20, now a ship can travel at say 5 it gets to move four times, but if a ships speed is 10 it only gets to move twice in a turn. ship a gets to move 20\5 turn number, ship b gets to move 20\10 turn number, so a moves on 5 10 15 20 and b moves 10 and 20, the turn ticks from 0 to 20 , and if the ships 20\speedspeed = tick then move

you can just simplify move a ship to anywhere on the grid, then the opponent moves, then if in range you can shoot


AdamStrange(Posted May) [#125]
so, putting this together and simplifying gives us this:

- create ship
- pick task (pick up A deliver to B)

tactical grid

- move to target
- do something - pick up, service, etc
- escape
- attack
- exit
repeat above


AdamStrange(Posted May) [#126]
bit more to this.

we have the grid.
when you start, it is at position on the edge of the grid
- the same for enemies, they also start at the edges of the grid
UNLESS there are enemies already on the grid?


Derron(Posted May) [#127]
Yes, the grid is the "close combat zone".
- there might be obstacles on that grid (asteroids, ship wreckage, other ships which try to flee or might help one of the aggressors)

- distance between the ships and their initial position might be random or predefined
- distance might also be based on the vector they "collided with" - so if the ship A came from behind the other ship should be rotated accordingly. Also a "radar" (and on the other side "cloak") should define how near both ships start when entering "ccz" ( ;-p ).


@ turns and turn length
As Mainsworthy already described: use some kind of "microsteps" or "percentage" or "movement energy".
So best is to say you have "100% energy" for a turn. If you have improved engines your step costs decrease by 25%. Your step now costs only (1.0*(1.0-0.25))*100 = 75% energy. You still are only able to move 1 step per step. You now could consider conserving energy for the next step - so you end up with 125% energy. I do not think that this is the greatest idea as people could try to conserve energy to use it all at the end. So you either have to make a "limit" (200% energy max) and/or only conserve energy left "because you cannot do another step" (25% left might be too less for another turn/rotate/...).
Ok, back to the energy. So we are now reducing movement costs by 25%. If motivation is high (some bottles of rum for ya piratezz) you might decrease costs by 20% ... leading to 1.0*(1.0-0.25)*(1.0-0.20)*100 = 60% energy.
And so on. As soon as you reach 50% or lower, you could do more than one step (and with <33.3% you could do 3 and so on).


Regarding ship size you could either manipulate "costs" per step - or give them more power.
But do not forget: a small ship might turn faster and accelerate faster but the power / impulse is a different thing - so bigger ships should also eg. "conserve movement energy". This means: a bigger/heavier ship will have 100% movement step costs in the first step, but only 50% movement step costs in the second - as long as the direction is the same.

Such things as described above might bring in some "tactical" elements as movement is then not just a "bring into position to fire" but also a prediction element on how ships will move and there they will be in 4-5 turns.
Also this makes the environment playing a more important role. A heavy ship cannot steer that nice through meteorite belts - or eg. has to "crash into them" with the effect of lowering their shields just to come into a good shooting position.



bye
Ron


AdamStrange(Posted May) [#128]
I think anything to do with percentages is the wrong approach. but I agree about rotation taking time to take effect. Infact that is a brilliant suggestion.

the core essence is can it be played by children with cards or dice?

it's about taking the concept and simplifying it but keeping it true to the core.


AdamStrange(Posted May) [#129]
Here's the next download.
if you look into the source you can see a new shader added to allow access to the fontmap

Also the code is being split into the proper classes which allows for each item to have individual movement, etc

http://monkey2.monkey-x.com/forums/topic/initial-3d-space-game-with-source/


AdamStrange(Posted May) [#130]
the yellow points are the shield...
if you want some fun add these lines after the alienShip has been defined:
alienShip.ShipExited = Lambda()
alienShip.PickEdge()
End


Mainsworthy(Posted May) [#131]
could do with ship pointing in the right direction instead of always pointing right, but its great ,


AdamStrange(Posted May) [#132]
left/right rotates the ship to face a new direction...


Mainsworthy(Posted May) [#133]
yes it moves in the right direction after pressing LEFT/RIGHT, but the ship dosnt rotate :(


AdamStrange(Posted May) [#134]
I'm just dealing with windows and a new monkey2 install and then I'll give it a go and see what's going on. but it should work without issues.... hmmmm!


AdamStrange(Posted May) [#135]
i'm going to swear now...
WTF!!!!!!
monkey2 on windows reports pi as 0!

so...
line 46:
const PIHALF:float = Pi * 0.5

should now read
const PIHALF:float = 3.14159265359 * 0.5

and the rotation appears!!!!!

I'm going to report this one


xlsior(Posted May) [#136]
monkey2 on windows reports pi as 0!

so...
line 46:
const PIHALF:float = Pi * 0.


Wouldn't 'pi' assume int? What happens if you use pi:float or pi#?


AdamStrange(Posted June) [#137]
been a bit quiet of late, so heres a nice pic:


I've been trying to get lighting working correctly, so needed to go back a few steps and rewrite the shaders and the matrix stuff (it's really nasty code to work out what is going on)

this shows a working light (ball with tail) heating up the cubes correctly...

and if it looks like a first person camera system - it is