Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / how to: remove legacy features
- - By Zapper [de] Date 2013-10-10 16:34
What would be the best way to approach removing features? (namely: the old CreateParticle)
I mean, I cannot simply replace the script function without breaking all existing scripts. Even if I marked it as legacy to remove it later on, I could not call the new particle function "CreateParticle" then because it would break all existing scripts who use CreateParticleEx then..

So? Mark as legacy, use CreateParticleEx and at some point rename that to CreateParticle and write a script-wrapper for CreateParticleEx?

The reason I want to remove it is because the new particle system can do anything the old could do, only better .
Parent - - By Maikel Date 2013-10-10 17:02 Edited 2013-10-10 17:06
Why not Ctrl+Shift+f the whole repos and search for C4Script functions which use CreateParticle and rename that to CreateParticleLegacy for now, and remove it from the engine when we replaced everything using the legacy code.

Then you can already rename your function to CreateParticle.

Also I'd suggest you start replacing some of the code, since you made the change.

Edit: Writing a wrapper sound like a very ugly solution to me.
Parent - - By Zapper [de] Date 2013-10-10 17:06

>Then you can already rename your function to CreateParticle.


And suddenly break all user-created stuff :/
Parent - - By Maikel Date 2013-10-10 17:11
Yes, I am sure they are able to Ctrl+Shift+f as well :)

This is how we did it in the past with proplists e.g. as well. Nothing to cry about too much I'd suppose.

Better than living with an ugly solution and obsolete engine code for ever. What do you think the control changes will do to user content?

We are still not developing a stable engine and never promised backwards compatibility with any previous version of Clonk (may that be OC or CR).
Parent - - By Zapper [de] Date 2013-10-10 21:12

>What do you think the control changes will do to user content?


Actually, I think there is only one think which is not 100% compatible: the IsReadyToUse callback prior to the OnUse. But even that won't break anything.
I might be terribly wrong though. Has been a long time that I did something in the controls branch..
Parent - By Maikel Date 2013-10-10 21:27
I was not really referring to direct scripting, but rather scenario and object design. But in all cases please go on with the good things you code :)
Parent - By Matthias [de] Date 2013-10-10 17:27
I'd say "Better now than later", while user-created stuff is still.. rare.
Reply
Parent - - By Pyrit Date 2013-10-10 22:00

>And suddenly break all user-created stuff :/


The Minecraft devs pretty much break all the user mods with every single update they make. Just sayan...
Parent - By Isilkor Date 2013-10-10 22:14
For the longest time, Minecraft didn't even have any extensibility interface. (No idea if they have now.) So that situation is different.
Reply
Parent - By Sven2 [de] Date 2013-10-10 17:43
At this point, I see no problem removing the old functionality yet.

If you want to be extra nice, you can make sure the old function signature still works (so it doesn't error out with a type cast error) and just not create any particles. Missing particles shouldn't affect user gameplay that much.
Parent - - By Maikel Date 2013-10-11 08:49
Are you planning on replacing the existing particles in the repos, at least?
Parent - - By Zapper [de] Date 2013-10-11 09:19
Yes, that shouldn't be too much of a hassle, since I would just declare one static proplist per particle definition and use that to replace the old CreateParticle calls
Parent - - By Maikel Date 2013-10-11 09:22
Where would you define these proplist, can a particle constain a Sript.c or does that go into System.ocg?
Parent - - By Zapper [de] Date 2013-10-11 11:07
I would put all into one System.ocg script for easy reference
Parent - - By Maikel Date 2013-10-11 11:15
A particle only consists of a graphic and a proplist defining behaviour, right?
Parent - - By Zapper [de] Date 2013-10-11 11:18
The Particle.txt is still used to link the graphics to the particle name, though
Parent - - By Maikel Date 2013-10-11 11:23
I see, but since you can have different behaviours per particle now it makes sense to define a few standards in System.ocg :)
Parent - By Matthias [de] Date 2013-10-11 11:29
Once we have figured out good behaviours, of course. :P
Reply
Parent - By Zapper [de] Date 2013-10-11 11:29
Yes! That's the cool thing. You could just take one of the predefined smoke behaviors and plug in your own graphics.
- - By Isilkor Date 2013-10-11 09:47
Why is this internal anyway?
Reply
Parent - - By Zapper [de] Date 2013-10-11 11:10
Because it's a technical decision how much we would like to break downward compatibility. No deeper reason, you can move it if you want to
Parent - By Isilkor Date 2013-10-11 12:52
I wish I could. Newton, help
Reply
Up Topic Development / Developer's Corner / how to: remove legacy features

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill