Code a game competition - Jan 30th - Apr 10th 2018 - £500 worth of prizes \o/

Started by Qube, January 30, 2018, 00:10:55

Previous topic - Next topic

Steve Elliott

Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Qube

Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Steve Elliott

Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

iWasAdam

Too far from bonnie Scotland for me  :(

OK. For todays pic, lets see some street stuff:


Needed to add some life to the scenes. so maybe cars and some people next?

Derron

Maybe gameplay first. Polishing can be done a later stage.


bye
Ron

iWasAdam

Gameplay is (generally) sorted now.
It's more a case of joining all the dots.
One thing that I might add is a snapshot and build option. Where you can just build a skyline and burn it...

Using the standard 4x4 tiles and defaults you can get some wonderful results. just watching everything burn and slowly rotating the map is mesmerising:


Maybe as you play you could earn 'points'. more points means more things to play with when building and burning?

Derron

Ok, did try to create a tilemap system for some isometric stuff.
Am not sure whether I go with my "economical simulation" idea, or with some gardening-simulation which I think could be a game my wife would play.

Hardest thing was to get around with the "layers" idea - always wanted to have "furniture/trees/..." to be on some kind of "collision layer". Have learned that things which could cover entities (player, enemies, ... are "objects" and no "tiles".
So "tiles" are only flat things like a "floor tile" or "wooden planks". This explains why most tile map engines seem to just store an integer for "what tile to draw". I do not like that approach, so my tiles are all fully fledged objects for now - with their own "update/render" methods (coordinates are passed by the renderer/tilemap to allow the isometric 2:1 coordinate calculations without making the tile objects tightly fit to that display mode/view).

Did that on the weekend evenings. Friday and saturday for the isometric map stuff (+ z-ordering objects), yesterday evening and today for writing an A*star path finder algorithm and an entity-move-along-path-system.
Base code (aka tilemap stuff) of the potential game will land in my Dig-Framework, so others could use that as well. Depending on how much I like the progress the whole project become FOSS too.





bye
Ron

iWasAdam

OpenGL on windows!!!
Nothing simple, something with the monkey2 code itself - SHEESH. AGK2 anyone?

3DzForMe

BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1

iWasAdam

Here's an interesting problem with a brute-force answer.
The problem:
OpenGL color Picking not functioning under windows - something nasty lurking inside the language and can't work out where.

Answer:
Reverse engineer the actual 3d display into 2d.

The spots are the point I am going to track and they must be able to rotate and generally conform to the perspective as well.

One I have the spots, I can simply check for mouse in triangle, meaning I can now track the mouse positions I am interested in.

Code is not nice, but will function perfectly under MacOS and Windows and also allow some other UI stuff that was missing.

Good example of trying to solve something that suddenly popped up...

Derron

I do not really understand what your problem was Adam. Color picking versus "mouse position" ?

Can't you just take the points  of the already existing quads (the ones with the double arrows on it) and extend the vector between two corners ? If you do that on the original vertices then you get the position in the non-translated 3D world. Or you use the translated one ("camera view") and get the 2D vector of the end points you are looking for.

So I somehow miss information about your actual problem to understand what you are describing (or is it just me?).

bye
Ron

iWasAdam

Everything is in 3d. pushed to the GPU, scaled, rotated, everything else.

So I can't track the mouse in 3d as in 3d there is no mouse.

The blobs/spots/ color triangles are in 2d. They live in the 2d screen/window layer.

You have no access to the 3d data whatsoever. hence reverse engineering the 3d back into 2d.
The only data I have access to is the yrotation, screen width and height....


Derron

Ahh so you wanted the "3d world  mouse position" ? But you got the rotation already - so with the angle of the board compared to "flat" you should be able to calculate the "elevation" of the mouse to the grid/ground plane. Angle + height allows to calculate distance to "grid start"-"mouse" if the mouse was on the ground and not in the air.

Regardless of this: shouldn't the 2D projection be enough to "select" an item? How would you handle selecting a "taller building" then? you could only select it then when clicking the "ground grid". If you moved higher ("towards top of the window") then your mouse "z" would increase and you would be able to select an item "behind". Is that intended?


bye
Ron

iWasAdam

There's also the problem of scaling and perspective - which is handled by the graphics card.

I know you can reverse project with a matrix - but I have absolutely no idea how to do it.

I came up with a manual tracking system of the 3d in 2d, to do what I needed ;)

STEVIE G

Quote from: iWasAdam on February 28, 2018, 15:07:50
There's also the problem of scaling and perspective - which is handled by the graphics card.

I know you can reverse project with a matrix - but I have absolutely no idea how to do it.

I came up with a manual tracking system of the 3d in 2d, to do what I needed ;)

So, with the language you are using you can't select a 3d object using the mouse co-ords, the equivalent of a camerapick in Blitz3d?  Seems bizarre that you have to implement a hack to work around something like that.  You sure there's not a simpler way?