SyntaxBomb - Indie Coders

General Category => Worklogs => Topic started by: iWasAdam on February 02, 2018, 08:30:40

Title: 3D TileEditor
Post by: iWasAdam on February 02, 2018, 08:30:40
Still no game decided, but the editor is coming along...
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-02-at-08-22-19.png)

in essence with items, you have 4 of them with 16 positions and a rotation on 90 degrees. you then pick the item and the color. with 2 sliders to add bump and mix the texture. this gives lots of options for each item.

I'm working my way up the list - lights are next to be tackled. the UI will remain similar, so if you know how to use the color picker - then it will remain the same each time you see it.

I think this is more interesting as you can see how a game is created. in this case it is a very defined tile-based system. The tiles have to be designed, the code written, the editor created to give the data to the end game - when dev actually starts on it.
Title: Re: 3D TileEditor
Post by: iWasAdam on February 02, 2018, 10:11:39
not yet, just a progression of already completed work. There is no game as such, it's currently an editor. Some of the concepts were developed using BlitzMax oodles of years back, but never made it past concept.

Lighting system now being worked on.
Here's a peek at the first 4 light types:
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-02-at-14-38-27.png)
from the left going clockwise:
- BigFire
- Torch, with a green flame type (the lighting matches the green
- Fire - this is really just Torch but sitting lower - could possible add a height slider here... Hmmmm
- Lamp - this is not actually shown, but you can see it is a magenta light at cell 2,4

I'm going to do some visual light fx searching to see about different light effects, and see about adding them as needed.
Title: Re: 3D TileEditor
Post by: iWasAdam on February 03, 2018, 12:34:21
Lighting coming along plus other fx. This is 3 mist objects and a big fire:
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-03-at-12-29-19.png)

The mist objects don't have any light, they just pick it up from the big fire (which is green).

I've added a height parameter for the lights/fx so they now have more control.

For those of a technical interest - this is a single pass forward renderer, not a multiple frame buffer one!
Title: Re: 3D TileEditor
Post by: iWasAdam on February 05, 2018, 15:15:03
latest editor pic
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-05-at-15-11-16.png)
shadows now replaced with dressing - things like grass, etc. These will also have animation added to them.
shadows will be automatically handled.

Title: Re: 3D TileEditor
Post by: iWasAdam on February 06, 2018, 07:46:58
mmm. For todays indev shot. It's all about the tiles.
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-06-at-07-41-38.png)

This shows a single tile with a brownish T junction, single light and 2 columns.
This tile can now be rotated 90 degrees, so there are 3 duplicates showing each rotation, and keeping all the contents correct.
There are no light blockers or shadows being used, but it's starting to show promise
Title: Re: 3D TileEditor
Post by: iWasAdam on February 07, 2018, 15:14:23
Hmmmmmmm. Editor sort-of working now and I can really start to brainstorm some concepts.
But here's a little something I just come up with in about 10 minutes (so this is just a feel...):
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-15-07-50.png)

It's a prototype Colorado Lounge... From "The Shining!"

Here's the inspiration:
(https://movie-fanatic-res.cloudinary.com/iu/s--iQH30tDS--/t_full/cs_srgb,f_auto,fl_strip_profile.lossy,q_auto:420/v1405713014/the-shining-the-overlook-hotel.jpg)
Title: Re: 3D TileEditor
Post by: iWasAdam on February 09, 2018, 08:45:21
OK. Still not any firm film ideas, but getting close now...
Editor now has fx added to the lighting for rain, snow, etc.
Here's a peek of torches with shadows, rain with lightning and mist:

(https://vjointeractive.files.wordpress.com/2018/02/rainfx.gif)

Next step is to take the base tile code and make different tiles. these can then be put together to form locations. which means the start of a game
Title: Re: 3D TileEditor
Post by: iWasAdam on February 11, 2018, 07:29:16
it's about breaking things down into steps - think lego!

OK. Here's the first look at the (now operational) layout page (just 2 tiles are being used, a cross and a corridor):
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-11-at-07-19-11.png)

You can see there is a grid of 11x7 - this is the 'table'. You select a cell on the table and then a tile and a rotation.
The UI is a bit clunky at the moment, but the buttons enable/disable and are all fully functional.

The key thing here are the tiles. They are being displayed correctly, with the proper rotations, colors, FX, etc
Title: Re: 3D TileEditor
Post by: iWasAdam on February 11, 2018, 07:45:16
Here's a second one showing different lighting and also light 'blockers' being used
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-11-at-07-40-58.png)

the green corridors have blockers on both sides, so light wont come in or escape. if you look closely at the border between the magenta and green tiles you can just see a line where the lighting wont cross - this is the blocker.

Light will bleed around blockers though. so a door for example would allow some light to bleed through (when opened)
Title: Re: 3D TileEditor
Post by: iWasAdam on February 12, 2018, 10:35:30
For todays pic. It's all about the UI and User interaction:
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-12-at-10-32-31.png)

So the green thing is your position, and the white (pulsing) things are the possible positions you can move.
Base code is in, picking responds with appropriate movement...
Title: Re: 3D TileEditor
Post by: iWasAdam on February 12, 2018, 12:22:58
First look with the edit menu hidden and showing 4 created 'tiles'. 2 tiles each have a single torch light. Light Blockers have been added to the tiles as well, so light/shadow propagation is being shown as well.
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-12-at-12-14-46.png)

I think this is the first time I can say this is what I thought it would look like, but needed to put everything into place to prove it could be done, so that's a good start ;)

Also the one thing that is starting to show is the visual style. With everything starting to look 'similar', you have to work harder to stand out as 'different' in some way.
Title: Re: 3D TileEditor
Post by: iWasAdam on February 13, 2018, 12:26:57
OK. This has the all the dev stuff from the Jan 2018 competition relating to the 3d tile editor.

This is being developed and will be used for the basis of the entry:
(https://vjointeractive.files.wordpress.com/2018/02/inferno.png)

Which is based on the Film "The Towering Inferno". There may be a separate thread for this game.

Currently this will show progress of the editor itself.
Title: Re: 3D TileEditor
Post by: RemiD on February 13, 2018, 12:54:08
since i have worked on a game using 3dtiles, i have a question for you :
do you think about pathfinding and occlusion culling when you are creating your maps, if yes, what is your approach ?
Title: Re: 3D TileEditor
Post by: iWasAdam on February 13, 2018, 13:53:56
interesting. I have done a number of pure cell based (cellx,celly) games and occlusion was always an issue. This is mitigated by using 3d - you could possibly use 3d for 2d stuff as well?

Pathfinding is the easy bit. There are a number of good approaches:
- A*. great from going from cell 1 to cell 2 in simple steps
- Dijkstra is really good if you can find a very fast way of creating the maps
Heres a good link showing these in operation:
https://www.reddit.com/r/roguelikedev/comments/74knrh/path_finding_animation_in_2d_maze_using_4_common/ (https://www.reddit.com/r/roguelikedev/comments/74knrh/path_finding_animation_in_2d_maze_using_4_common/)

The other approaches are generally based around moving towards the player in some way.

Finally there is the node approach. where rooms have nodes and you can just travel from one base node to another - these can be good if you also throw in some random elements.

With tiles I am using a block of 4x4 as my base unit, plus additions, dressing, types, etc. This means I don't need to work at the cell level, just with a predefined set of 4x4 tiles.
The concept is solid and works very well with D&D, WarhammerQuest, and a number of other room based systems,
Title: Re: 3D TileEditor
Post by: iWasAdam on February 13, 2018, 15:27:18
OK. I Lied. Here's another pic.
This time you can see some newer models - the liftcore:
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-13-at-15-19-49.png)

You can actually see the editor being used here and also see how it has already been extended.
Only one tile is being used, but it is replicated 3 times (each with a different rotation) so you can see how things look at different rotations.

You can also see that we are at 61FPS. The FPS drops when the editor itself is open, but goes back to a solid 60FPS when closed. This is in DEBUG MODE. Running without debug gives a static 60fps regardless of what is open.

You are also getting the 1st person view. It's certainly atmospheric and you can see how the Inferno game will possibly look...

Title: Re: 3D TileEditor
Post by: Steve Elliott on February 13, 2018, 15:29:25
Quote
It's certainly atmospheric and you can see how the Inferno game will possibly look...

Yep, I agree.  Good stuff.
Title: Re: 3D TileEditor
Post by: RemiD on February 13, 2018, 19:12:29
nice fire effect :)
Title: Re: 3D TileEditor
Post by: GaborD on February 14, 2018, 01:11:04
Looks really good.
Title: Re: 3D TileEditor
Post by: iWasAdam on February 14, 2018, 08:28:58
OK. Now we're getting somewhere...
For todays pic, it's all about the table. It's gone and replaced with construction blueprints - this fits better with the building concept I think?

(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-14-at-08-23-45.png)

All we need to do is add in some nice 70's furniture and we're good to go...
Title: Re: 3D TileEditor
Post by: iWasAdam on February 15, 2018, 08:46:13
So for todays pic. It's all about the browser:
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-15-at-08-38-21.png)

The browser is the 128 available tiles. initially these could be selected using the bottom tile slider and nudge arrows (at the bottom of the ui)
I've now added a browse button, this brings up the screen as shown with a grid of 15 tiles. these correspond to the tile positions, and you can select then by clicking, or by using the original UI.

You can see that the camera angle changes to allow you to see 15 tiles at a time. This is using a new camera class, which will also be used throughout as well and will allow smooth camera sweeps from one camera to another.

You can see that the tiles are completely rendered with all FX and lights, etc.
Title: Re: 3D TileEditor
Post by: iWasAdam on February 16, 2018, 12:26:39
Todays pic as about buildings:
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-16-at-12-22-09.png)

You can see the 4x4 tile and how the buildings relate to it. Basically this is a single tile just rotated with a couple of quick building added. If one of the aims is to make a towering inferno game, there need to be some context...?
Title: Re: 3D TileEditor
Post by: iWasAdam on February 17, 2018, 12:41:36
The Century Plaza has caught fire...
(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-17-at-12-39-23.png)
Title: Re: 3D TileEditor
Post by: RemiD on February 17, 2018, 16:02:06
Looks good, but the roads are broken, this is weird...
Title: Re: 3D TileEditor
Post by: 3DzForMe on February 17, 2018, 22:36:48
Impressive work  8)
Title: Re: 3D TileEditor
Post by: iWasAdam on February 18, 2018, 08:24:17
I've closed the gaps between the roads and sub tiles so it looks let 'gappy'

I think I'm getting a better idea of how this all fits together now :)
Title: Re: 3D TileEditor
Post by: iWasAdam on February 19, 2018, 07:13:26
Been tinkering with the shaders to increase the fidelity of the input bitmaps.

Here's a look VERY close (much closer than I designed it to support)

(https://vjointeractive.files.wordpress.com/2018/02/screen-shot-2018-02-19-at-07-05-54.png)

You can see that the rod textures are 'off' a bit, but I am amazed at how reasonable it looks. And with very low res textures and simple models. I could easily up the scale of both...
Title: Re: 3D TileEditor
Post by: Steve Elliott on February 19, 2018, 20:53:07
A Towering Inferno AND an earthquake?!!  Those roads   ;)
Title: Re: 3D TileEditor
Post by: Derron on February 19, 2018, 21:45:57
Not an Earthquake... It's Elm Street and Freddy sliced the road for us.


bye
Ron
Title: Re: 3D TileEditor
Post by: Steve Elliott on February 19, 2018, 21:54:35
lol sounds like the game is evolving into a disaster movie/horror  ;)
Title: Re: 3D TileEditor
Post by: iWasAdam on March 05, 2018, 11:52:57
Final 3d to 2d code:
(https://vjointeractive.files.wordpress.com/2018/03/screen-shot-2018-03-05-at-11-47-51.png)
What you are looking at is the opengl 3d with a 2d layer.
The 2d layer has a red/blue grid applied. This means that I can now correctly track the 2d mouse in 3d space without models being present.

I spent a lot of time reversing the 3d to get the actual 2d projection, and it is now consistent with all zooms, rotation, transforms etc.  ;D
Title: Re: 3D TileEditor
Post by: iWasAdam on March 06, 2018, 08:27:13
Here's the final code in operation:
(https://vjointeractive.files.wordpress.com/2018/03/screen-shot-2018-03-06-at-08-19-00.png)
At and angle, zoom, screen size. The mouse is now properly tracked in 3d/2d.
The cyan outline will track exactly in 3d the 2d mouse position. and will also update dynamically if the view is changed.

I know it's not that interesting to look at, but the code was challenging to work out :)
Title: Re: 3D TileEditor
Post by: iWasAdam on March 06, 2018, 12:12:39
tiny addendum to this. Compiled for windows and now fully compatible with 60fps!!!!
Title: Re: 3D TileEditor
Post by: Derron on March 06, 2018, 12:56:20
With 60fps or with windows? If with 60fps your timing code would need an overhaul :p

Hope you do not loose yourself in details but finish and release a game - best testbed to see if things work on all computers :-p

bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 06, 2018, 14:12:37
A stable 60fps is my global aim for both MacOS and Windows - now achieved   :-*
I have 2 Macs and 2 Windows machines to test on. All have very different cpu and graphics cards.

60fps is stable in debug mode. In release mode there can be a general 30% speed increase.

As for detail vs game. The last time I went for game before detail, it was a complete disaster. This time I am making sure all the system level stuff is completed and working perfectly cross-platform.



Title: Re: 3D TileEditor
Post by: Derron on March 06, 2018, 14:43:31
So 60 fps is kind of "max" stable on your machines? Or are the 30%+ in release mode measured without fps-limitation? In my game I have <60fps in some screens when doing debug builds as so many stuff is done there (GC kicks in I think). On other screens I have some hundred FPS more.


bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 07, 2018, 06:08:18
No, I set my internal timers for 60fps and lock the main loop to that. Actual fps will fluctuate +- 2 in normal operation. if it begins to drop then I know I am stressing the gpu and need to look at my render systems.
30% gives me some flexibility that retail will always be 60fps.

sound emulation is running at 120x per second

I lock to 60 across all systems so that whatever machine/OS it runs on, the end experience remains the same.
Title: Re: 3D TileEditor
Post by: RemiD on March 07, 2018, 06:34:45
personally, i limit at 30fps, but the game should be playable at as low as 15fps... SO the turns moves animations speeds must be automatically adjusted depending on the fps...

Quote
if it begins to drop then I know I am stressing the gpu and need to look at my render systems.
just consider that the computer your game will be played on not necessarily has the same hardware / os than yours (so it may have less fps)
Title: Re: 3D TileEditor
Post by: Derron on March 07, 2018, 07:02:41
Some devices have other refresh rates...so if you play it on 144Hz displays...it would flicker/delay here and there?

What happens to 59Hz TFT Screens...hickups?

Bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 07, 2018, 07:47:35
yep. I've got some pretty low hardware here to test on. 7yr old laptop and very bad surface 3 for testing. everything rock solid at 60fps

Quoteit would flicker/delay here and there?
Nah. All solid with no flicker ;)

Here's the first show with the old cardrogue characters being used showing alpha in operation:
(https://vjointeractive.files.wordpress.com/2018/03/screen-shot-2018-03-07-at-07-35-52.png)

Here's the previous engine with the same models and graphics being used. Notice the FPS !!!!!
(https://vjointeractive.files.wordpress.com/2017/08/r10.gif)

The new engine is doing thing very differently and now fully supports true particles, light mapping and shadow systems with a rock solid 60fps.

The key issue with the last renderer was it failed on windows completely and had very bad performance on lower systems (which I had not caught in time)

It's taken a long time to get to this point with learning all the 3d and then getting it right!

I think it should also be said that the first version (although it looked fine), there was no title system as such. Everything was hard coded. The new tile system is what I envisaged it should have been - flexible and extendable.
Title: Re: 3D TileEditor
Post by: Derron on March 07, 2018, 08:36:33
You know you received a PM regarding tile systems a bit time ago? ;-) Maybe you find the time to write a bit about it after the compo.


@ flickering
I am talking about the slight delay happening when hardcoding for 60 fps - or using a delay calculating with 60 fps. If you have a 59 Hz display it will expose a slight slight hickup each ~1 second.

This is why some people lock it to the refresh rate (flip 0 vs flip 1) and use tweening for their internal refresh rate (60hz, 30 physics updates/s: real data, tweened data, real data, tweened data).


What FPS would you get without any limitations (no delay, no vsync) this should be > 60 on your old hardware. On your newer hardware you would surely reach 300, or way more.
If you already only receive 65 fps or so - then you will see lower FPS once you add the game logic. In TVTower I experienced the AI doing 20ms-work-per-AI-tick things in certain situations (analyzing and optimizing the upcoming programme schedule). With 60 FPS you only have 16ms for: rendering _and_ updating if you do it in one single thread. In my case this means I would only render 59 fps or so (it only misses this single one, as afterwards the task is done and the AI was only using 1-2 ms). I had to split that AI task to do "a little bit here and there" each tick - so the task now takes 10 (AI-)ticks instead of 1 - but the framerate wont drop that much in that very very rare occuring situation.

Similar things could happen in your games - which is why I wanted to make you aware.


PS: What resolution is the game running in? I assume FHD will use a bit more render time, did you check that out already?


bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 07, 2018, 08:55:02
QuoteYou know you received a PM regarding tile systems a bit time ago
I did? That one must have slipped through the radar. If you want me to go into the tile concepts - no problem :)

The fps system is run on timers, so there is always a slight variation. All the animation systems are time based so there are no issues regarding this.

I cant say about an unlocked fps speeds as the whole system was coded from the ground up based on a particular render approach. so it's not a simple task to just 'turn it off'. I did a quick test (resetting the timer interval from 60 to 120), and it all felt twice as fast! Although the FPS counter still reported 60 - the counter is internal code so maybe is doing something else as well? But interesting to note.

Again with AI and other 'tasks', I hand tweak to get maximum performance where needed. One thing I've found is that stuff like AI doesn't need to be run each 'frame'. So a number of 'tasks' run at different times to even everything out.

Resolution is the great one - Although not tested on mega displays (2000-5000 res) - I test run both windowed and fullscreen (fullscreen is running at the monitor resolution 1920x1200). In fullscreen there is a slight speed up as windowed mode has lots more resources being used.
General resolution I am using as 1397x852 as this is the window size that best fits my dev. But again I do test multi-resolutions and it remains rock solid at 60fps

a quick test between cpu use in debug and retail with the exact same scene is: Debug 29%, Retail 9.9%
Title: Re: 3D TileEditor
Post by: Derron on March 07, 2018, 09:11:27
animation/movement should be done on an _different_ timer base (or custom "Timer" thing).
split updates (logic, movement,...) apart from rendering.

Rendering is just drawing the current state of the world (current might mean "last calculated + some simulated/tweened" coordinates).

At the end movement / "the world" should also work with a 1 fps-setup - it just would look very "stop motion"-alike.


What happens if the computer got a slowdown (anti-virus jumping in, OS doing a sudden update in "background" - eg. my Windows 10 notebook has 90% CPU utilization everytime it installs some windows updates) ? Does a slow down mean, the world is moving "slower" too? Just think of the games benefitting from pressing the "Turbo-Button" on your old x86-DX processors.
All the input handling should be done on the physics update - or if possible even less often (depends on your setup - dunno if Monkey2 does polling each time, as keystate polling costs a bit CPU - which is why Brucey added a DisableAutoPolling()-thingy on BlitzMax, after he profiled my game and some slowdowns).

So instead of
entity.x = x + dx
DrawImg(entity.img, entity.x, entity.y)

you split things into update() and render()
Code (Blitzmax) Select

'update():
'====
'deltatime would with vsync be around 0.016
'dx is no longer based on your 16ms frametime, but a "pixels per second" value
entity.x = x + dx * deltatime
entity.y = y + dy * deltatime
'... add further collision checks etc.


'render():
'====
DrawImg(entity.img, entity.x, entity.y)


'enhanced render():
'====
local tweenX:int = entity.x + timeSinceLastRender/frameTime * entity.dx
local tweenY:int = entity.y + timeSinceLastRender/frameTime * entity.dy
'... add additional checks for not "overlapping" with other entities
'which are normally detected in your update call
DrawImg(entity.img, entity.x + tweenX, entity.y + tweenY)



@ AI
Yes, I run the AI on every "ingame minute" and on every "real time second" (the AI gets informed about onSecond, onGameMinute - and for both about onTick). So I have a TWorldTime-Class doing all the ingame-time thingies for me, and a "TTime"-class doing the realtime stuff.

so for ingame-day-night-cycles you would use TWorldTime, but for physics you would use TTime (or even better your DeltaTimer-stuff).



@ high-res
good to read. Just wanted to avoid you testing on 640x480 and wondering why a FHD then isn't 60fps+.
Title: Re: 3D TileEditor
Post by: iWasAdam on March 07, 2018, 11:02:37
Method OnUpdate60()
_gameFrame += 1
_gameTime = Millisecs()

RequestRender()

CheckMovement()

storm.Update()
physics.Update()

ProcessKeyboard()
End method


There my base render code. _gameTime is where all the timing stuff comes from and it is time based not frame based.
Title: Re: 3D TileEditor
Post by: Derron on March 07, 2018, 11:18:37
Side question: So you always render before updating - so you render the "last state" not the current one? Means it is a delay of 16ms between "what you see" and "what happens" ?

If you changed it to "OnUpdate120" - it only can move faster, if "physics.Update()" (and others) are assuming a constant deltatime (time since last call to itself) somewhere. Maybe you move "x + dx" with "dx" being a value not affected by the real deltatime/"time since last call".

Just imagine you have it hardcoded "x = x + 1". Of course it would move faster if you call this 120 instead of 60 times a second. This is why deltatime comes in handy. You base your dx on a "pixels per second" base. So if you had a 60 updates/second value before, eg. 0.5 - to move 30 pixels per second, you now use the one you _planned_ with your value. In our case here this means the value becomes "30.0" (30px/second).
If you still want to stay with your constant 60 updates per second, you would move this way: "x = x + 30.0 * 1/60.0". And as it now becomes framerate independend you would use "x = x + 30.0 * deltaTime". So if you have a render frame function needing a bit longer this time, this will get compensated accordingly (it eg moves with 30.0 * 0.030 instead of 30.0 * 0.0166).

Dunno if you knew this already, so excuse if you did. Just want to help if that is possible.


bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 07, 2018, 12:07:43
No problem. I was using delta time prior. But now I'm locking to 60fps it's not an issue. I can easily modify if needed in the future :)
Title: Re: 3D TileEditor
Post by: iWasAdam on March 08, 2018, 06:50:48
Really tiny addition:
(https://vjointeractive.files.wordpress.com/2018/03/screen-shot-2018-03-08-at-06-48-29.png)
SubTile picking.
If a tile is 4x4. I can now select the individual cells in a tile
Title: Re: 3D TileEditor
Post by: Derron on March 08, 2018, 08:07:55
Subcell-selection grid seems to ignore the "cell padding" - at least it looks as (ignoring the "height"/z-axis of the subcell-graphics) if the bottom left padding is bigger than the top right ones.


bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 08, 2018, 08:34:07
(had to do a quick check. first...)
No. it's actually ok. The '3d' outline cursor is slightly smaller than a full cell. it is also offset up by a certain amount.
In essence the cursor is just hovering above the tile 'floor'.
In practice, it all work very well ;)
(https://vjointeractive.files.wordpress.com/2018/03/pick.gif)
Title: Re: 3D TileEditor
Post by: Derron on March 08, 2018, 08:41:11
ahh so it is (z-index wise) "higher" than the sub-cell  - the animation makes this way more visible.

If you plan to have some "place here" marker - than you might animate that marker (move offset 1 by 1 so it "pumps up" - maybe render it multiple times so it has some kind of "smearing"/"lazy fade out" effect - sorry cannot come up with the proper name now).


@ Fire
Are you adding fire hydrants so that fire men only have a specific radius where they can extinguish the fires without needing to refill tanks. For a "place the fire" I think the fire hydrants would be of strategic importance.


@ Materials
Maybe things like gas stations should be existing too - or other special buildings. All these buildings - or their existence in "bigger buildings" have impact on how a fire spreads. So a chemical laboratory floor ... boom. A central gas pump station in the cellar of a building ... holly molly.



bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 10, 2018, 08:42:04
ok. So here's the problem:
Q. how do you 'logically' move around each cell when the tiles are 4x4 cells and can be rotated and have different contents?
A. Track each tile and its contents into a holding cell layout where 0=floor and 1=occupied. then rotate it onto the actual playmap

And here's the debug result showing the playmap with correct cells
(https://vjointeractive.files.wordpress.com/2018/03/screen-shot-2018-03-10-at-08-36-20.png)

Just believe me in that it works and can be runtime updated, so rooms and contents can move, etc....

This playmap can now be used to track legal moves.
Title: Re: 3D TileEditor
Post by: Derron on March 10, 2018, 08:54:05
I do not understand what problem you tackled?

rotation, scale, offsets: things handled by the renderer. As with your debug table the whole thing could be thought of as a 2D grid (ignoring "height" for now).

When moving, you move only the "2D grid coordinates" and then transfer them back to your "screen coordinates" when rendering? This is the same as I do with my iso-grid now. So when comparing tile vs tile I only compare them in their own "2D grid system" (or "map system"). They do not care if you rotate stuff or not as this is a camera thing. If you enable rotation of the elements itself, then this is also only done in the "2D grid system" and should auto-resolve then on rendering.

If you have "subcells" you could either:
- have the tile map be sized to the subcells and create "mega cells" for the now "normal" cells
or
- handle the subcell stuff within your cell functions ... so cells become kind of "layers" with their own cells and the reach all information requests to the corresponding subcell

At least this is how I planned to tackle "multi-cell" items.


bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 10, 2018, 09:51:44
a tile is a 4x4 set of cells that can be rotated round 90 degrees (including its contents).
E.G. You only need to define 1 corner tile. you just rotate it to get the other four corners.
Title: Re: 3D TileEditor
Post by: Derron on March 10, 2018, 09:55:09
But isn't this a matter of

GetTile(col, row).GetCell(cellCol, cellRow)

so the tile is an object returning the cell which is _currently_ at cellCol,cellRow - so the tile handles it's internal rotation or cell amount, cell size .... ?


bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 10, 2018, 10:01:42
mmm more or less, yes...

It also gets a bit more complex as some items can also be rotated. so a 4x1 wall rotated would become a 1x4 wall. and don't forget items can be offset as well...

Here's a pic that might explain it a bit:
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Fwww.worldworksgames.com%2Fstore%2Fproducts%2Fminic%2Fproduct_splash_minic.jpg&hash=3fc4aee58c84a74ad5dce12c7a706301a3c0b6e0)

The tiles are the primitives, that can be placed or rotated to make new 'things'

It's a form of abstraction. making a grid based map takes time, but a grid based map made from tiles becomes much quicker - you just need the tile system in the first place...

Here's another D&D one:
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Fthe-lost-and-the-damned.664610.n2.nabble.com%2Ffile%2Fn2942353%2Fflatview.jpg&hash=af739c64957393d787ab9201f6744d68a0d4ee5f)
Title: Re: 3D TileEditor
Post by: RemiD on March 10, 2018, 10:15:10
@Adam>>by curiosity, what is this board game ? (i was a fan of "heroquest" when i was a child / teenager)
Title: Re: 3D TileEditor
Post by: Derron on March 10, 2018, 11:02:32
@ Adam
What you do is what I currently try to implement too :-)

(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FhdUjtDY.png&hash=736edf70383198eead3240c0001ca193bf7e5469)
white is the anchor tile
gray are the "child tiles"
and grean is a tile acting as "seat" for units.


@ HeroQuest
StarQuest is sitting in the cupboard right 1,2m above my computer :-)


bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 10, 2018, 11:34:24
the board game is "warhammer quest". It was the next game after HeroQuest

StarQuest was the (non uk) name for "Space Crusade". This was based on the Warhammer (space) quest game "SpaceHulk"
More or less ;)

People got bored of the flat 2d tiles and made their own 3d tiles. This is the system I am attempting to replicate:
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2F3x3a5j3hw42u11gr7t19im0b-wpengine.netdna-ssl.com%2Fwp-content%2Fuploads%2F2017%2F06%2F7-1.jpg&hash=cb51c900b18b0d7dcd3e44e3e6d8a6775f116cc3)
Title: Re: 3D TileEditor
Post by: Derron on March 10, 2018, 11:54:21
I planned to print some of this stuff on my 3d printer but for now the buddies just do not have that much time to play these things and my son is a sliiight bit to young (2yrs). This summer I will finish my 3d settlers of catan print - so garden time is painting time.


@ StarQuest
Yes they renamed it and also some weapons got names not fitting to the "universe" they belong to. They made things a bit more "child-friendly". Think one of my buddies will have HeroQuest laying around somewhere too - played it the last time in ... <1995, so it's been a while.


@ Grid
Think you just need to make sure that the underlaying "collision layer" is set correctly, individual little offsets, overlaps ... should be then handled by the placed entity objects. So you place an entity and it sets the underground as walkable or not.
Things like poison, gas ... are done in the "entity collides with entity" functions.
So I only use the tile system to declare strictly non-walkable areas (means I do not need to check entities vs entities in that case) and to be the base for alignment and simplified path finding.
Title: Re: 3D TileEditor
Post by: iWasAdam on March 10, 2018, 11:58:50
The current 'playgrid' system seems to work extremely well.
It's bases on ints, currently 0 and 1, but I can easily add to that to things like traps, events ,etc.

I'm going to work on a very small game (24hrs) and get that out and tested... Coming together very fast.  :o
Title: Re: 3D TileEditor
Post by: iWasAdam on March 11, 2018, 14:20:42
Provision now made for up to 6 'maps', plus loading and saving completed.

First game with the system now has a title and main menu (needed to update some of the UI controls):
BloodCrypt

(https://vjointeractive.files.wordpress.com/2018/03/bc.gif)

(https://vjointeractive.files.wordpress.com/2018/03/screen-shot-2018-03-11-at-11-51-33.png)

Still working out details. But I'm liking a limited amount of tiles to place per map (randomly picked). the monsters can be linked to the counter...
Title: Re: 3D TileEditor
Post by: RemiD on March 11, 2018, 16:15:59
nice ambiance
Title: Re: 3D TileEditor
Post by: Derron on March 11, 2018, 17:57:22
So this is the 24h-grid-sample-game or did you trash the compo entry to continue on your rogue games?


PS: I would like to see some kind of dungeon master game :-)

bye
Ron
Title: Re: 3D TileEditor
Post by: iWasAdam on March 12, 2018, 08:32:15
OK, the first game using this system is
BloodCrypt
https://adamstrange.itch.io/bloodcrypt (https://adamstrange.itch.io/bloodcrypt)
Entered for the 7DRL exploration and concept working, but no monsters  :(
Title: Re: 3D TileEditor
Post by: iWasAdam on March 14, 2018, 06:47:31
External BloodCrypt work will new be seeded back into the main editor.
Starting to bring the timelines into operation - much fun to be had...
Title: Re: 3D TileEditor
Post by: iWasAdam on March 26, 2018, 11:46:00
small update to the UI. Buttons removed and tabs added - this means nicer code and I can add further tabs when needed. New/Cut/Copy can also be added to the UI
(https://vjointeractive.files.wordpress.com/2018/03/screen-shot-2018-03-26-at-11-43-53.png)