The UI engine is currently completely implemented, I just need to extend it to work in conjunction with the game in the background. All existing screens (CAS, SAS, Load screens etc) work on only the UI engine and simple behaviors called on UI element changes.salvadorc17 said:What that means, youre working on implementing ui engine to the game or just to the create a sim? Whats you progress status?
xezno said:How are you programing the engine (not the Programming Language, the method) - is there wiki.niotso.org page for a UI reader or something?
Maybe it is possible to make a small server emulator...
Yeah, I read that - now I understand. And yeah, Maxis is being Maxis as usual.Afr0 said:xezno said:How are you programing the engine (not the Programming Language, the method) - is there wiki.niotso.org page for a UI reader or something?
The page you're looking for is here.
It documents the UIS format in full detail (the format is readable with Notepad, by the way). So to make a UI-engine, what you do is that you parse each line in a UIS (UIScript), then you pass that to a lexing function. The lexer would then tokenize the line and spit out a series of organized tokens that could be used to generate UI items (for this you need a graphics library at the very least, like OpenGL or DirectX).
For the UIS format, you only really need to organize tokens in one of two ways; a tag, such as AddButton, or an argument to the tag, such as id, position or size.
If you think this is complicated, there's a reason for that: most games/engines would either hardcode their UI components/elements, or use an already existing scripting language such as Lua or Python. But Maxis being Maxis, of course they had to roll their own. And the scripting language isn't actually that bad, though there's no need for it.
<wall level="1" y="29" x="22" brp="0" blp="0" trp="361" tlp="0" trs="1" tls="0" placement="0" segments="2"/>
<wall level="1" y="51" x="22" brp="0" blp="361" trp="271" tlp="0" trs="1" tls="0" placement="0" segments="8"/>
<wall level="1" y="52" x="22" brp="0" blp="0" trp="271" tlp="0" trs="1" tls="0" placement="0" segments="2"/>
<wall level="1" y="28" x="23" brp="0" blp="271" trp="0" tlp="0" trs="0" tls="0" placement="0" segments="8"/>
<wall level="1" y="29" x="23" brp="0" blp="0" trp="361" tlp="0" trs="1" tls="0" placement="0" segments="2"/>
<wall level="1" y="51" x="23" brp="0" blp="361" trp="271" tlp="0" trs="1" tls="0" placement="0" segments="8"/>
<wall level="1" y="52" x="23" brp="271" blp="0" trp="271" tlp="0" trs="1" tls="0" placement="0" segments="6"/>
<wall level="1" y="53" x="23" brp="271" blp="0" trp="0" tlp="0" trs="0" tls="0" placement="0" segments="4"/>
<wall level="1" y="28" x="24" brp="0" blp="271" trp="0" tlp="0" trs="0" tls="0" placement="0" segments="8"/>
<wall level="1" y="29" x="24" brp="0" blp="0" trp="361" tlp="0" trs="1" tls="0" placement="0" segments="2"/>
<wall level="1" y="52" x="24" brp="0" blp="0" trp="0" tlp="361" trs="0" tls="1" placement="0" segments="1"/>
<wall level="1" y="53" x="24" brp="0" blp="361" trp="0" tlp="361" trs="0" tls="1" placement="0" segments="9"/>
<wall level="1" y="54" x="24" brp="0" blp="0" trp="271" tlp="0" trs="1" tls="0" placement="0" segments="2"/>
<wall level="1" y="28" x="25" brp="0" blp="271" trp="0" tlp="0" trs="0" tls="0" placement="0" segments="8"/>
<wall level="1" y="29" x="25" brp="0" blp="0" trp="361" tlp="0" trs="1" tls="0" placement="0" segments="2"/>
<wall level="1" y="53" x="25" brp="0" blp="361" trp="0" tlp="0" trs="0" tls="0" placement="0" segments="8"/>
<wall level="1" y="54" x="25" brp="0" blp="0" trp="271" tlp="0" trs="1" tls="0" placement="0" segments="2"/>
<wall level="1" y="28" x="26" brp="0" blp="271" trp="0" tlp="0" trs="0" tls="0" placement="0" segments="8"/>