I’m trying to fix the problem where objects don’t disappear from the map with the proper UI feedback.
Example: go to chest (hear sound, see all consecutive dialogs), choose option (see map), interact with map.
In HOMM3, it goes this way:
go to chest (hear sound, see all dialogs), choose option (hear pickup sound, see map with disappearing sprite animation), interact with map.
Right now, I’m trying to get the sound to work and I’m a bit confused abuot how server and client are separated.
What I figured out so far:
- Server drives the UI, including all dialogs, as well as it selects sounds.
- Client pretty much only draws what server tells it to draw.
I found out that the server removes the object the moment it’s touched, before choosing the option. So, to solve the problem, I have to ask the server to wait with RemoveObject until user confirms all dialogs, and then make the client handle the pretty removal - somewhere in MapHandler?
However, I don’t like this approach personally… Server sould know nothing about GUI, so I was thinking about a different solution (italics marks the change):
go to chest (client receives choice, client receives RemoveObject, client remembers object), choose dialog option(cliend sends reply, client shows the map, client actually deletes object with object-specific sound and animation), interact with map.
This approach needs to push some code to the UI portion, e.g. UI needs to discriminate between object types, and basically have 2 handler types: one for server (logic) and one for client (UI).
My question is: if I start splitting up code like that, is anyone going to welcome my patches :P?