• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[General] Overall lag

Status
Not open for further replies.

sentrywiz

S

sentrywiz

I made a mastery tree and I'm really happy about it.


attachment.php



Problem is: the map I made the tree for will have 10 players. Now I'd have to do the same thing 9 more times. That would be about: 200 variables, 250 destructibles, 200 units ONLY for the mastery trees. Add to that the random map I have in mind and some pre-made maps as well. When the game begins, that would be about 10 - 100 additional units.

My concern is how laggy would that make my map?

I'm not a newb, so there will probably be no leaks. Also the combat + mods are dead simple so there will probably be no big ass triggers for spells and stuff.
 

Attachments

  • masterytree2.jpg
    masterytree2.jpg
    220.2 KB · Views: 152
Level 23
Joined
Feb 6, 2014
Messages
2,466
I can't see the image.lBut my suggestion is to use arrays so that you don't have to recreate everything.
Example, variable[1] belongs to Player 1, variable[5] belongs to Player 5, etc.
Now for the handles such as destructables and units, you have no choice but to recreate them.
Now for your question, it will be laggy especially if the camera is focused on those large number of units.

EDIT: 200 units and 250 destructables per player? How come?
 
Level 13
Joined
Jul 15, 2007
Messages
763
Depends on people's computers, some people can't even handle Castle Fight (which can get out of hand in terms of number of units).

If your units are paused/hidden, this should make things better.

Are they also grouped? Large groups of units tend to lag way more than if they're spread out on the map.
 

sentrywiz

S

sentrywiz

I can't see the image. But my suggestion is to use arrays so that you don't have to recreate everything.
Example, variable[1] belongs to Player 1, variable[5] belongs to Player 5, etc.

Both solutions are the same for my case:

#1 - Create PlayerXMastery[ Y ] variables for each player, then populate them.
X for every player, so X is 10 and Y is 20 so 200

#2 Create MasteryXPlayer[ Y ]
X is 20, and Y is 10 so again 200

EDIT: Mastery tree is 25 destructibles and 22 units. times 10, that's 250 destructibles and 220 units.

Depends on people's computers, some people can't even handle Castle Fight (which can get out of hand in terms of number of units).

If your units are paused/hidden, this should make things better.

Are they also grouped? Large groups of units tend to lag way more than if they're spread out on the map.

My PC is decent and I had major lag and even crashes during Castle Fight. That map is a PC wrecker if it gets to a stalemate.

Most of the units won't be hidden, only some. They won't be grouped either, atleast not all the time.
Map will be FFA with rounds, so you will be going back and out of the mastery tree each round.
That means mastery units will remain and during the round, each player's view will shift and will get one more unit to play with.
When the round ends, the players will be forwarded back to the tree to learn stuff. Rinse repeat
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
Ahh I get it. You mean if you would do the same for other players, you would end up having 200 variables, 250 destructables and 200 units. Normally, those 200 variables won't affect much. And the 250 destructables and 200 units will surely increase loading time, but it will only start to lag when you start to place them on the map. If your map is empty, then it won't lag at all even if you have a lot of units/destructables in Object Editor
 

sentrywiz

S

sentrywiz

Ahh I get it. You mean if you would do the same for other players, you would end up having 200 variables, 250 destructables and 200 units. Normally, those 200 variables won't affect much. And the 250 destructables and 200 units will surely increase loading time, but it will only start to lag when you start to place them on the map. If your map is empty, then it won't lag at all even if you have a lot of units/destructables in Object Editor

Yes. And good!

Why not have all players share the same physical space?
That way you don't need more than the 22 units. Just a thought.

I thought about that as well. But that would mean I have to think of a different solution AND they will have to wait. Like imagine 8 players playing this and everyone is waiting for one guy to pick his talents... then the next guy... it would suck balls for everyone.
 
It doesn't necessarily mean you'd have to wait... you can be creative with show/hide destructibles and easily make a tree that shares space, but it is a bit complicated unless you have a lot of experience with full-screen systems (it is really easy to disconnect when dealing with selections and stuff). BPower is working on a nice interface for all this, but you'll have to wait for it to be finished. :p

As for the original question--just hide things for other players when you can. i.e. one player only needs to see their own tree. Hide all those destructibles, units, etc. for everyone else. You can do this using GetLocalPlayer() (I have a link in my description). It is fine to show/hide units locally iff the only interaction is selection. So be careful if you do weird things with your icon units or w/e.

In general, users probably won't experience much lag from other people's interactions, even if they aren't hidden. Wc3 mostly just renders what is on your screen. Why mostly? Idk. Blizzard is weird--there really isn't any reason besides keeping animations in sync (which wc3 probably doesn't do anyway). Zweibelchen showed that destructables off-screen can impact fps. You should check out his system if you're interested, or just hide the destructables manually.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Custom UI works almost completely locally...
You could eventually make all variables and stuff be set and get locally so you can use a normal variable for all players!
However this requires some experience in coding...

On the other hand, there are a lot of things you can do without the units or stuff like that...

For example, what do you use to force the camera on that point? Wait, let me guess... a unit?
You can use the native function SetCameraBounds(x, y, x, y, x, y, x, y) to lock the camera without using a unit.

Another example, what do you use to display the icons? A destructible?
Better use images directly, you might have to add a transparant border to them but I am not sure about that.

One more then, what do you use for the requirements? A unit?
All requirements can be done by simple variables which can work locally to make it even more storage efficient.

There are many other things that dont require units etc so I would rather take a look at what you could remove instead of how you make it MPI.
 

sentrywiz

S

sentrywiz

It doesn't necessarily mean you'd have to wait... you can be creative with show/hide destructibles and easily make a tree that shares space, but it is a bit complicated unless you have a lot of experience with full-screen systems (it is really easy to disconnect when dealing with selections and stuff). BPower is working on a nice interface for all this, but you'll have to wait for it to be finished. :p

As for the original question--just hide things for other players when you can. i.e. one player only needs to see their own tree. Hide all those destructibles, units, etc. for everyone else. You can do this using GetLocalPlayer() (I have a link in my description). It is fine to show/hide units locally iff the only interaction is selection. So be careful if you do weird things with your icon units or w/e.

In general, users probably won't experience much lag from other people's interactions, even if they aren't hidden. Wc3 mostly just renders what is on your screen. Why mostly? Idk. Blizzard is weird--there really isn't any reason besides keeping animations in sync (which wc3 probably doesn't do anyway). Zweibelchen showed that destructables off-screen can impact fps. You should check out his system if you're interested, or just hide the destructables manually.

Custom UI works almost completely locally...
You could eventually make all variables and stuff be set and get locally so you can use a normal variable for all players!
However this requires some experience in coding...

On the other hand, there are a lot of things you can do without the units or stuff like that...

For example, what do you use to force the camera on that point? Wait, let me guess... a unit?
You can use the native function SetCameraBounds(x, y, x, y, x, y, x, y) to lock the camera without using a unit.

Another example, what do you use to display the icons? A destructible?
Better use images directly, you might have to add a transparant border to them but I am not sure about that.

One more then, what do you use for the requirements? A unit?
All requirements can be done by simple variables which can work locally to make it even more storage efficient.

There are many other things that dont require units etc so I would rather take a look at what you could remove instead of how you make it MPI.

I like the same UI solution, but I've no idea how to display things locally. Idk jass so doing it via coding is impossible atm.

Most of the requirements are done via: 1 destructible off-screen, just for checking and variables. I don't need units for requirements since I save everything into a variable. My solution is making everything beforehand and then using loops. It proved to be faster than the "code every event separately" that I did before.

I use a unit, but I also hide the unit after camera is being locked to it.

I don't know how to manipulate images, I use destructibles because once you learn a talent, I create another destructible at the same location. Its just for aesthetics, but it really looks cool. I'd hate to experiment with images, because IMO I'm having a hard time displaying them via code or triggers.

Making all trees for each player is cumbersome but if its working and doesn't impact FPS I will be happy with it.
 
I'm sure that your map will not lag,but it can happen that the lag appears to a different point.
So if u put in one different point too much stuff like weather,doodads and units.Then it can happen that the lag starts.
If someone have lag then he have a very ,very ,very low pc(weak computer) ,or he have problems with internet.
 
Status
Not open for further replies.
Top