• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Why My Spell Lag For Some Condition

Status
Not open for further replies.
Level 13
Joined
Dec 29, 2004
Messages
597
I make a spell that hit units in area. It likes pick every unit in area, then create a dummy unit for every picked unit, and order that dummy unit to cast a "spell" (lets says frost nova) to picked unit.

It works pretty well, all enemy units in area will suffer frost nova.

But when i try to replace frost nova on dummy unit to Drunken Haze, and order that dummy like before, it will give lag on my game.

I have try to replace spell on dummy with another spell and some don't cause lag and some do.

No Lag:
Frost Nova, Chain Lightning, Purge, Entangling Roots.

Causing Lag:
Drunken Haze and Soul Burn. I can only find these two.

Is anyone can tell me why?
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
It's probably because of Blizzard. They sometimes make a bad work as well since they are in a hurry. I don't know what do say. I sometimes hate blizzard work especially when they built JASS. JASS is a programming language based on which GUI was made. Yes, veyr original. Unfortunately, unlike C++ or Pascal (or even) it is not a complete and efficient one. And a very good example is: Why the hell doesn't JASS have pointers? I heard that JAVA doesn't have pointers either, but instead there you work on objectually. But here, it is neither objectually, and neither does it use pointers. So memory is not allocated efficiently. A student who learnt 2 years of computer programming in school (which is practically null since you learn how to basically work with programs) can work with JASS without any problems. Sad, I know, but unfortunately that's the reality.

I just started to learn how to efficiently use pointers (at the beggining I criticized them a lot as well) and to be honest, they are AWSOME. Thinking that you can allocate memory, use it and then put it back where it was before is awsome. Blizzard tried to make such a fake allocation with Triggers, Timers and Effects which can be destroyed but in C/C++/Pascal, you can destroy any type of pointers. Handlers seem to be some kind of pointers but with them the memory cannot be allocated dinamically (use it and then destroy it).

Oops, I've kinda devied from the subject. Anyway, the idea is that not even Blizzard doesn't always do a good job. I don't think there is a reliable solution for this.

~Daelin
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Leopard said:
Hohoh.. you wrong. All of varible aspect in JAVA actually is a pointer. when you construct a new object and assign it to variable, it actually the variable hold the pointer. :wink:

Interesting... I never worked with JAVA but from what I heard, you didn't use pointers... atleast directly. Hmm, I program entirely in C++ (and JASS of course for Warcraft). I also made very little Pascal years ago when I didn't knew much about computer programming and only this year I started learning for real (I'm making at school). I'm really interested into this project and this is a reason why I try to master C++. But its difficult since just now I understood pointers and now I am trying to apply the dinamically use of the memory.

Anyway, I don't know what exactly does JASS use but surely, there are some problems with it. After all, it is not a programming language tested much.

~Daelin
 
Status
Not open for further replies.
Top