Request : Dummy Recycling

13lade619

is now a game developer :)
Reaction score
398
since everyone is always complaining about 'recycle your dummy units' on systems.. can i request a simple recycling system?

here's a framework:

Code:
Global constant MAXDUMMIES = max amount of dummies in map
Global constant DUMMYTYPE = rawcode of dummy units.

function GetDummy() <-- returns a dummy unit to be used
function RecDummy(unit) <-- recycles the given dummy, when finished using it return it to list of unused dummies.
the system will just give you a unit to use, you do anything you want with it.
then return the unit to the unused list after.

*if there is already such system, direct me there :p.
 

tooltiperror

Super Moderator
Reaction score
231
Just use Jesus4Lyf's system, DummyCaster.
 

13lade619

is now a game developer :)
Reaction score
398
no not for casting.

it's for when we need some units to attach stuff too, like effect models.

for projectile systems / effect systems.

the system will just give you a unit to use, you do anything you want with it.
then return the unit to the unused list after.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
But DummyCaster is only limited on 0 second spell casting.

for projectile systems / effect systems.
xefx.
 

tooltiperror

Super Moderator
Reaction score
231
Use... does xe do dummies now? xe does everything.
 

Viikuna

No Marlo no game.
Reaction score
265
Aye. Youd need somekind of database thingy for getting each models death duration using model path as a key, in order to make your recycle timer to wait until the effect dummy is ready to be recycled..

Sounds awesome and hideously complicated to me.
 

13lade619

is now a game developer :)
Reaction score
398
Aye. Youd need somekind of database thingy for getting each models death duration using model path as a key, in order to make your recycle timer to wait until the effect dummy is ready to be recycled..

function setDeathTime(unit) ?, maybe..
and use some sort of ticker divisible by 0.03125.
 

Viikuna

No Marlo no game.
Reaction score
265
One timer per effect would be better, although it requires you to create quite many timers at the map init.

Then again, you also need to create an equal amount of dummy units too, so its not probably a problem.
 

tooltiperror

Super Moderator
Reaction score
231
I was thinking that you could do this pretty easily if you're getting consecutive dummy handle integers. But I was thinking this would also be difficult because you need to create a lot of dummies at once, which may cause lag?

JASS:

// globals
//   unit array DummyArray[100]
// endglobals
  function CreateDummy takes nothing returns nothing
      local integer index=0
        loop
          set DummyArray[index]=CreateUnit(x,x,x,x)
          set index=index+1
          exitwhen index==101
        endloop
  endfunction


I was then thinking you could create dummy units periodically and then stop when they reach one hundred, which would only work depending on your map style, so it would be recommended for things that will only use a few dummies every now and then. The problem with that would also be getting nice Handle Id's to line up.

Any more JASS-y people want to tell me if it would be unwise to create a buttload of dummies at start up?
 

Viikuna

No Marlo no game.
Reaction score
265
Creating handles is slow, and creating units is especially slow. Creating them all in game start affects the game play as little as possible, so its adviceable.
 

tooltiperror

Super Moderator
Reaction score
231
Alright, so what would be the most amount I'd want to create?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Total unit recycling is a pain in the ass because of these things :

- Special unit events : since you can't remove events, if you don't want the recycled unit fire again a trigger event, you have to destroy the trigger and rebuilt it without this event, can be done but hard and lame really.
You will also have to care about which groups the unit was inside or even unit variables.

- You can't directly give an instant facing, there is a trick to do it (not sure that is truly instant) but only work with special cases.

- The more unit types you need, the more you will have to keep units.
You could use morph abilities but these abilities are more or less bugged.

It's still a valid way for using units as an effect though.
 

Viikuna

No Marlo no game.
Reaction score
265
Its not easy for sure, but can be done. ( And have been done, for ToB O for example )

And you can make your own event systems, so events are no problem.

Chaos unit type morphing requires a very controlled envinronment, but works nicely.

For visual dummies, SetUnitLookAt provides a nearly instant facing angle turning thingy.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Sure, but honestly, does it really improve the player gameplay ?
I mean the player could notice the difference with or without unit recycling ?
Does it really justify this harder work or is it just for fun ?

Imho i think it's unnoticeable for players.

Note that i've already said that recycle units is handy if use as special effects.
I'm talking about total unit recycling here, no any unit removed in any way.

For chaos it doesn't work very well with unit types (worker and so one), bug with armours and such, in my point of vue it's kinda useless, can only be use for really really really special cases.
Again nothing wrong if the coder really want to use it and figure all the bugs, i just state that's definitely not a generic way for unit recycling.

SetUnitLookAt is very fast but not truly instant so, that was i thought.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top