Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Syncing or changing BuildingGameObj 'IsDetroyed' state for clients
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488203 is a reply to message #482894] Tue, 01 July 2014 09:55 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

Of course it's hacky, you're setting an internal netcode flag in a manner that wasn't originally intended, I have no clue how you can possibly tell me it's not "hacky." Being "hacky" does not make it incorrect, but it does make it "hacky." Or maybe see the term kludge

-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488205 is a reply to message #488203] Tue, 01 July 2014 10:10 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Ethenal wrote on Tue, 01 July 2014 09:55

Of course it's hacky, you're setting an internal netcode flag in a manner that wasn't originally intended, I have no clue how you can possibly tell me it's not "hacky." Being "hacky" does not make it incorrect, but it does make it "hacky." Or maybe see the term kludge



Except we aren't using some undocumented piece of code. We are using a function right out of the scripts to set the flag. Heck the plugin doesn't even set the flag. Scripts.DLL does. It works unmodified server side which is why it doesn't make sense to start making changes to the server side code. The only thing that needs to be set client side is the isdestroyed flag. Stuff like base power, defenses, rebuilding a harvester, etc is all server side and doesn't require any changes to be made to the netcode at all. That stuff already works.


If you want to see what function we are using its Restore_Building in engine_game.CPP.

[Updated on: Tue, 01 July 2014 10:43]

Report message to a moderator

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488206 is a reply to message #482894] Tue, 01 July 2014 10:26 Go to previous messageGo to next message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma: 0
General (1 Star)
Because those buildings are just script attachments. Yes we can revive the buildings by reattaching the scripts but it still needs the IsDestroyed flag because it isn't actually registered as being alive. When you kill the building again, there's no EVA sound because it's set to destroyed to begin with.

http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.

Part time streamer - https://twitch.tv/gg_wonder
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488207 is a reply to message #482894] Tue, 01 July 2014 10:28 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

I did not say it didn't work, I said it was a kludge, which you pretty much just agreed with. Stop ignoring me and actually read my post!

Look, the bottom line is that neither dblaney1 or I understand the implications of this change in the code more than jonwil or StealthEye, and that is what I'm trying to say. If you try to tell the few people that still read this forum that you are the messiah and are more knowledgeable than either individual, nobody's going to listen to you because both of them have put years of work into this game, and those of us that still play have benefited from their individual work for many, many years.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

[Updated on: Tue, 01 July 2014 10:30]

Report message to a moderator

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488208 is a reply to message #488206] Tue, 01 July 2014 10:33 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Xpert wrote on Tue, 01 July 2014 10:26

Because those buildings are just script attachments. Yes we can revive the buildings by reattaching the scripts but it still needs the IsDestroyed flag because it isn't actually registered as being alive. When you kill the building again, there's no EVA sound because it's set to destroyed to begin with.



Yup that's what I was saying. Iran's fix which syncs the isdestroyed flag fixes both the destroy messages and the ability to build units from the PT.

If you wanna test it make a backup of your bandtest.DLL and use this patched version. This is only needed on your client. Nothing needs to be channgef on the server. I have been running it for over two months now. Fixes both the PT's and destroyed messages. This patch allows the client to set the isdestroyed back to false. The server already sends out the proper netcode to the clients. The clients just don't have the ability to set the flag to false without the patch.

http://www.renegadeforums.com/index.php?t=getfile&id=14941&

[Updated on: Tue, 01 July 2014 10:42]

Report message to a moderator

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488209 is a reply to message #488207] Tue, 01 July 2014 10:43 Go to previous messageGo to next message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma: 0
General (1 Star)
Ethenal wrote on Tue, 01 July 2014 13:28

I did not say it didn't work, I said it was a kludge, which you pretty much just agreed with. Stop ignoring me and actually read my post!

Look, the bottom line is that neither dblaney1 or I understand the implications of this change in the code more than jonwil or StealthEye, and that is what I'm trying to say. If you try to tell the few people that still read this forum that you are the messiah and are more knowledgeable than either individual, nobody's going to listen to you because both of them have put years of work into this game, and those of us that still play have benefited from their individual work for many, many years.



I don't know if that was directed at me but I think you completely misread my post. I'm not disagreeing with you. I'm trying to explain that the reason why those buildings work is not because of a "hacky" method, but it's because it's just script attachments and nothing else.

God what a cluster fuck of a topic.

I actually agree with why they didn't do it. I'm trying to explain that the methods to revive those specific buildings, weren't hacky. Those buildings only needed script attachments. The same can't be done with the WF/Air + Bar/Hand because those require updating clients.


http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.

Part time streamer - https://twitch.tv/gg_wonder
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488210 is a reply to message #482894] Tue, 01 July 2014 10:52 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
No matter how you slice it the client needs to be able to set the isdestroyed flag back to false. Both iran's patch and jonwils proposal do this. The difference is that iran's patch ends there and that's the only change made. On the contrary jonwils proposal makes that same change but also adds a bunch more changes that could potentially break things. No matter how you slice it, simply adding the code for clients to reset the flag back to false is less likely to adversely affect other things than doing both that and making large changes to the building controller code.

Essentially x<x+1.

[Updated on: Tue, 01 July 2014 10:53]

Report message to a moderator

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488211 is a reply to message #482894] Tue, 01 July 2014 11:06 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
You can rant and rave all you like, it won't change the fact that we won't just throw a random bit of bodge code in to make you happy. If it's going to be done it will be done properly.

The more you whine and moan about it the more irritated we all get with you and this in turn makes people less inclined to look into it. You really do have very poor people skills, you might want to look into that.


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Tue, 01 July 2014 11:10]

Report message to a moderator

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488212 is a reply to message #482894] Tue, 01 July 2014 11:16 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

Sorry Xpert that wasn't directed at you Razz

-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488213 is a reply to message #482894] Tue, 01 July 2014 11:20 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Sorry if I got a little carried away in this topic. I hope that this feature is added. Thank you TT for helping keep this game fresh even 12 years later.

In my defense though I never have put personal insults in my posts.

[Updated on: Tue, 01 July 2014 11:27]

Report message to a moderator

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488215 is a reply to message #488210] Tue, 01 July 2014 11:25 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

ninja'd

-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

[Updated on: Tue, 01 July 2014 11:25]

Report message to a moderator

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488217 is a reply to message #482894] Tue, 01 July 2014 11:27 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
I'm not sure what the discussion is even about anymore--I already made the fix and it's a only line change to update the IsDetroyed flag in the BuildingGameObj netcode update code. The flag would only get updated when the state changes to IsDetroyed = true, my change makes the client always update the state.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488224 is a reply to message #482894] Tue, 01 July 2014 13:19 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

The way I see it, syncing the IsDestroyed flag correctly is not a hack. It is actually an improvement to the synchronization of the BuildingGameObj and would imo be part of a proper implementation of building revival. However, that does not mean that after the change BuildingGameObj::Set_Destroyed(false) correctly revives a building. To correctly revive a building, more is needed.

For true building revival, there are three approaches:

1. The way it is currently done. I don't know the details, but I think it is along these lines: call Set_Destroyed(false), check the building type and reattach scripts, send announcements, call Set_Base_Power, Can_Generate_Vehicles, etc. so that the game ends up in the right state - this I'd definitely call a hack, and I would be against including it in the engine like that. (But it's the only way to do it without engine changes, and it apparently works well.)

2. Add a BuildingGameObj::On_Revived function (ala BuildingGameObj::On_Destroyed) or edit BuildingGameObj::Import_Rare to perform the necessary actions when a building is revived. Then, the revival logic is exactly where it should be. - If TT would implement building revival, I think this should be the approach. This takes some development and validation time to do it properly though, and I'm not sure if it's worth it. (This assumes that we have actually cloned enough of the Renegade code to even make that change, but I think we have.)

3. Adding a new net event like jonwil suggested. I do not particularly like that solution either. Building creation or destruction is not an event, why should building revival be.

So, in short, my stance is: (A) implement the syncing of the IsDestroyed flag. It is technically an improvement even if it is not sufficient to make building revival work, and it allows others (albeit with hacks) to implement building revival. (B) Do not implement building revival. It takes too much effort, risks introduction of other bugs, and there are probably more important things to work on.


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488232 is a reply to message #482894] Tue, 01 July 2014 13:51 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

^ I like that post

-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488233 is a reply to message #488224] Tue, 01 July 2014 13:53 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
StealthEye wrote on Tue, 01 July 2014 13:19


So, in short, my stance is: (A) implement the syncing of the IsDestroyed flag. It is technically an improvement even if it is not sufficient to make building revival work, and it allows others (albeit with hacks) to implement building revival. (B) Do not implement building revival. It takes too much effort, risks introduction of other bugs, and there are probably more important things to work on.


I agree with this stance 100%.
That is exactly what we are requesting in this thread. Nothing more nothing less.

[Updated on: Tue, 01 July 2014 13:56]

Report message to a moderator

Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488250 is a reply to message #482894] Tue, 01 July 2014 16:17 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

#2 is how I would do it.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488259 is a reply to message #488250] Wed, 02 July 2014 02:47 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
jonwil wrote on Wed, 02 July 2014 00:17

#2 is how I would do it.



Ditto. It's more future proof too.


http://steamsignature.com/card/1/76561197975867233.png
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488268 is a reply to message #488259] Wed, 02 July 2014 07:28 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Hate to ask but it seems like all that would really be required is sending a message to the client on join for all the builds on the map, like how animated tiles work, when you join the game they all play animations to the frame they're at on the sever (IE, if you have a radio tower that tipped over server side 25 minutes ago, and a player joins, they get to see it tip over the second they get in game).

The only difference here would be the message would tell the client to set the buildings destroyed flag to the supplied parameter.


Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488271 is a reply to message #488268] Wed, 02 July 2014 08:34 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Jerad Gray wrote on Wed, 02 July 2014 07:28

Hate to ask but it seems like all that would really be required is sending a message to the client on join for all the builds on the map, like how animated tiles work, when you join the game they all play animations to the frame they're at on the sever (IE, if you have a radio tower that tipped over server side 25 minutes ago, and a player joins, they get to see it tip over the second they get in game).

The only difference here would be the message would tell the client to set the buildings destroyed flag to the supplied parameter.



It actually already works for people that join after a restore. The issue is clients that are already in the server.
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488602 is a reply to message #482894] Tue, 15 July 2014 02:13 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
Started working on this.

Full client support, even on non-4.2 servers.

You can revive buildings with the revivebuildingbytype, revivebuildingbypreset, and revivebuildingbyname console commands, or by calling BuildingGameObj::On_Revived directly.


Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488604 is a reply to message #482894] Tue, 15 July 2014 02:34 Go to previous messageGo to next message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma: 0
General (2 Stars)

Nice <3

https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488629 is a reply to message #488602] Tue, 15 July 2014 15:26 Go to previous message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Whitedragon wrote on Tue, 15 July 2014 02:13

Started working on this.

Full client support, even on non-4.2 servers.

You can revive buildings with the revivebuildingbytype, revivebuildingbypreset, and revivebuildingbyname console commands, or by calling BuildingGameObj::On_Revived directly.



Sounds great. Thanks.
Previous Topic: Trouble downloading scripts
Next Topic: Can't see player names anymore?
Goto Forum:
  


Current Time: Fri Nov 08 15:58:48 MST 2024

Total time taken to generate the page: 0.01306 seconds