OpenRA icon indicating copy to clipboard operation
OpenRA copied to clipboard

Added LAT pavement to Tiberian Sun

Open Mailaender opened this issue 6 years ago • 19 comments

Closes #12911.

Mailaender avatar Sep 19 '18 11:09 Mailaender

We're going to need to split out world (the "ground truth" / simulation state) vs player (render state) traits in order for rendering to properly account for fog visibility.

This is the main reason why nobody has tackled this yet - the D2K concrete logic suffers from the same problem as smudges/resources (#12093), and duplicating this without fixing it first makes life more difficult.

pchote avatar Sep 19 '18 11:09 pchote

What is the status here?

abcdefg30 avatar Mar 11 '19 09:03 abcdefg30

This basically works like Dune 2000 except that it also paints the pavement nicely in Tiberian Sun style.

Mailaender avatar Mar 16 '19 16:03 Mailaender

I interpret the lack of review action here as a consensus on my comment above, so moving to the future milestone to help clean up the PR queue.

pchote avatar Apr 21 '19 12:04 pchote

Rebased, added terrain colors and split logic and renderer.

Mailaender avatar Jan 01 '22 16:01 Mailaender

The imperfections probably stem from placing pavement on invalid terrain types as it tiles just fine for me on a clear test map:

image

Mailaender avatar Jan 09 '22 17:01 Mailaender

Renamed the variable names.

Mailaender avatar Jan 09 '22 17:01 Mailaender

Placing pavement on non-clear terrain (sand, grass) produces really sharp edges; can we improve that somehow?

The imperfections probably stem from placing pavement on invalid terrain types as it tiles just fine for me on a clear test map

Can somebody please check and describe what the original game did before this is merged?

pchote avatar Jan 09 '22 22:01 pchote

I've found some inconsistencies with the original game, one of them is allowing for pavement to be placed on slopes as presented here:

Before

After placing

Regarding the imperfections, original game handles them seemingly by recalculating adjacent tiles to nearby terrain, this is example of placing pavement on different terrains in TS and OpenRA

Tiberian Sun

OpenRA

Also another minor thing, TS pavement is 4x4 rather than this 5x5.

CDVoidwalker avatar Dec 09 '22 13:12 CDVoidwalker

Sorry, I'm not on the project, but it looks really amazing. Can I suggest that you make pavement destroyable so it's not an invincible shield against subterranean attacks.

farefouse avatar Dec 26 '22 18:12 farefouse

OK, getting back to this, I checked everything we talked about above and I retested what I could think of.

  • [x] I would very much like to get the code in line with TSVeinsRenderer for my own sanity, for easier reviewing and for easier future maintenance (ideally at some point we generalize all the traits that do this in 10 different ways). To that end I figured it would be simpler to make the necessary changes on my end and provide them to you than to explain where, how and why I want each and every one of them. I hope it doesn't feel like stepping on your toes, but rather saving everyone's time. (See referenced branch below.)
  • [ ] The sharp edges - as @CDVoidwalker explained apparently all other non-clear terrain types will need recalculating around concrete to change their edges. We need to consider how viable that would be to do in this PR, but it definitely needs to be done: image image
  • [ ] The minimap imperfections are a thing - I created a blank clear map to test. After a lot of tries I think I found out how to reproduce somewhat reliably: image
    • It seems to me caused by one of these two tiles (I think the inner/lower/right one), with IDs 600 (plat05.tem, plat05a.tem) and 608 (plat13.tem, plat13a.tem), but the fact that it doesn't happen more often probably suggests 608: image
    • Bonus - you will also notice that occasionally placing a component tower in the right spot doesn't even overwrite the radar color of the cell (maybe unrelated to the PR?): image
  • [x] Pavement hides building bibs and the base of component towers (likely too much Z offset): image
  • [x] On the snow tileset the tile template ids are apparently completely different: (See referenced branch below.) image
  • ~~[ ] You can place pavement on ice.~~ OK, ice is apparently of TerrainType: Clear! So not this PR's problem.
  • [ ] The Renderer doesn't respect pre-placed pavement (probably the Layer doesn't know about it?). I wonder if it respects other players' pavement.

And here's my branch based on yours. Feel free to review and if you are ok with it squash into your commit - https://github.com/Mailaender/OpenRA/compare/ts-pavement...penev92:OpenRA:ts-pavement

penev92 avatar Feb 28 '23 13:02 penev92

Thanks.

Mailaender avatar Mar 01 '23 11:03 Mailaender

There is still a lot more to be thought about / discussed / changed here - I consider AT LEAST the ZOffset issue and the pre-placed pavement issue to be hard blockers (that should hopefully both be relatively simple to fix).

penev92 avatar Mar 01 '23 22:03 penev92

I don't really know how to change the Z offset. It is already sorted lowest on the World actor.

Mailaender avatar Mar 04 '23 15:03 Mailaender

Bonus - you will also notice that occasionally placing a component tower in the right spot doesn't even overwrite the radar color of the cell (maybe unrelated to the PR?):

This is probably because the minimap is rendered at 1:1 size, and then downscaled to fit in the radar bin.

pchote avatar Apr 08 '23 11:04 pchote

ZOffset only changes the order that things are drawn in - this is not sufficient for TS, where you want to be using the Z component of the Offset vector.

pchote avatar Apr 12 '23 18:04 pchote

Adjusted the offset float.

Mailaender avatar Apr 21 '23 17:04 Mailaender

https://github.com/OpenRA/OpenRA/pull/15625#issuecomment-1448174552 still has some unchecked items, are those solved?

abcdefg30 avatar Apr 22 '23 00:04 abcdefg30

Not the unchecked ones.

Mailaender avatar Apr 22 '23 17:04 Mailaender