beyond-all-reason / beyond-all-reason/RecoilEngine

Check if DRAWTYPE_TREE is obsolete

Open
#1,626 0 comments 1 reaction 0 assignees View on GitHub
refactor
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

Since 78ff919ab237962d3559863759b7a2c3d79dfce7, engine no longer has custom tree drawing (default trees are supposed to use a model). But DRAWTYPE_TREE still exists and is used for a bunch of things, like an override for model height
https://github.com/beyond-all-reason/RecoilEngine/blob/0889e956f86847114f1944c931c519a2614b3872/rts/Lua/LuaUtils.cpp#L701-L702

or for determining the default for a velocity mask:
https://github.com/beyond-all-reason/RecoilEngine/blob/0889e956f86847114f1944c931c519a2614b3872/rts/Sim/Features/Feature.cpp#L191

It seems that autogenerated tree defs still get this draw type:
https://github.com/beyond-all-reason/RecoilEngine/blob/0889e956f86847114f1944c931c519a2614b3872/rts/Sim/Features/FeatureDefHandler.cpp#L169

And you can specify it explicitly if you don't pass a model:
https://github.com/beyond-all-reason/RecoilEngine/blob/0889e956f86847114f1944c931c519a2614b3872/rts/Sim/Features/FeatureDefHandler.cpp#L123

The first task is to check facts:
* how do default trees work if they get `DRAWTYPE_TREE` and there is no renderer for those? Is it because most games always provide their own defs?
* if most games provide their own, are the autogenerated trees broken (perhaps just fail to render)?
* if so, which games provide their own and which don't?
* is there any rendering/mechanical difference between drawtypes TREE and NONE other than the movement mask and the height override?

And then there are some design questions:
* if ~all games provide default tree defs perhaps the engine doesn't need to? Especially if the autogenerated ones turn out broken and useless anyway.
* consider whether the movetype mask defaults make sense and whether a new feature def tag would make sense. At a glance it seems reasonable (given back-compat and legacy) but I haven't thought about it that much.
* if the drawtype is to stay, reconsider whether features should be able to specify drawtype tree manually.
* reconsider the name of the constant, it no longer has anything to do with trees or drawing.

Contributor guide

Open the contributing guide

Research direction

Trace DRAWTYPE_TREE through rts/Lua/LuaUtils.cpp, rts/Sim/Features/Feature.cpp, and rts/Sim/Features/FeatureDefHandler.cpp, starting with the linked usages and autogenerated feature definitions. Compare rendering and movement behavior with DRAWTYPE_NONE and inspect which games provide tree definitions. Done means documenting the findings and a justified decision about the constant, defaults, and any required follow-up changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, game-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.