Hiding blocks from the UI

Digitalghost

New Member
Hey all,

I'm working on adding support for an overhead perspective. For inspiration, go to 1m 30s of this video:


Changing the camera angle and offset has been pretty easy, but I'm stuck on hiding blocks. Notice in the video I linked that you can move up and down in the Y axis and it slices the terrain and hides everything above a certain Y value.

Looking at the Terasology code, I was thinking of making a special collision group called UI_VISIBLE. When we use the physics engine for picking blocks to dig or other UI-based events, we only look at blocks that have this group. Also, the rendering engine needs to be aware of blocks that are hidden and draw the appropriate face on the blocks just below the hidden ones.

When the hide-layer changes, we would need to change a bunch of the blocks' collision groups and also regenerate all meshes, which is pretty expensive.

Thoughts?
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
That sounds awesome :)

EVE Fanfest is about done, so I'm near to leaving Iceland to go to Denmark. When I'm there I should have a more solid internet setup so I can go review and help pull code.

Can't wait to see this as that sort of overhead view could indeed be very useful for managing creatures :D

I saw A Game of Dwarves also try its hand at that sort of cut-through view
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Digitalghost - very cool, I can see it working using your branch! It is a little raw though :)
  • Game started for me already in third person, should probably default to normal first person
  • When you're in 3rd it seems like the camera is actually moved a few blocks from the player's true position, making turning the screen really funny. You can also break the blocks under the actual origin and despite being a little distance away you fall down and collect blocks "remotely"
  • Should 3rd lock into a good angle rather than take whatever the player happens to be in when clicking 'p' ?
Also I think you got your whitespace settings not matching the project standards, bunch of tab characters appear to have made it into LocalPlayerSystem and maybe elsewhere, can tell from the diff. Would also be easier then to see the actual changes :)

If you can make some of those tweaks and set up a pull request I think we should be able to merge this
 

Digitalghost

New Member
Hey, is there an auto-formatter that conforms to your project's standards? I use the eclipse auto formatter (ctrl-shift-f), but I can use uncrustify or some other formatter that you use which fits your style.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
I'm not sure, but doubt it. We have Checkstyle to tell us when the format and conventions are off, but I'm not sure IntelliJ or something is smart enough to take that kind of config into consideration when auto-formatting. Might just be spaces vs tabs and stuff you can configure manually.

If there is a way to do that automatically and you know the tools having such an option would be great ... :)
 

Digitalghost

New Member

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Well, I'd favor something IDE agnostic if doable. Most of us are using IntelliJ, but I like being able to support Eclipse (or even NetBeans etc). Uncrustify sounds interesting, especially if we can match it right with Checkstyle :)

If you're up for trying to prep a tool setup, be it Uncrustify or the Eclipse formatter (without requiring Eclipse), then that'd be awesome. Don't actually format the code base yet, please, as that'll unleash conflict hell :D

We're going to have a steady point to do major refactoring coming up sometime in the next few months after multiplayer and some other stuff is ready. If we have more tools available by then we can do some codebase-wide refactoring (I'd like to play with Findbugs etc too)

Updated https://github.com/MovingBlocks/Terasology/issues/398
 

mkalb

Active Member
Contributor
Logistics
I use Eclipse at work. But now I use IntelliJ IDEA for Terasology/TerasologyLauncher.

Eclipse has a nice feature "Cleanup". This can add "final", refactor for-each and many more useful features. You can combine it with the "formatter" and "organize import". But it is not possible to configure the "formatter" and the "organize import" so that the result is identical with the source created from IntelliJ IDEA.

"Uncrustify" looks iteresting. I created an issue for the launcher. It is easier to start with the launcher because the code has no checkstyle violations.
https://github.com/MovingBlocks/TerasologyLauncher/issues/103

Maybe someone wants to start with this issue.
 
Top