It also needs to stop sucking FPS like it was going out of style.
Hello pals,
I'm currently really unsatisfied with the way, some SENTs or STOOLs of wire are coded. I started recoding some parts today but mentioned this isn't a one man job.
So I would like to meet with all current wire developers on a day where everyone gets a part of wire he will recode.
The how and what will be clarified later. But here some examples:
SENTsSTOOLs
- Removing unnecessary spaces and linebreaks from cl_init.lua and shared.lua to increase lua download speed
- Making variablenames shorter in cl_init.lua and shared.lua to increase lua download speed
- Change some vars to local, reduce function calls - E.g. instead of calling self.Entity:GetPos() 20 times in a Think, we declare local my_pos = self.Entity:GetPos()
- Using HOOks instead of running a Think every 0.01 seconds (best "worst" example: pod_controller!)
- Instead of having 5 different functions which do nearly the same, we should have one which can be altered (best "worst" example: Targetfinder with it's "Find" functions - I recoded them today to use one, but old still exists)
These are a few examples. I hope I will get some response soon.
- Creating a base_wire_stool which has the most common used parts in it
- Using gmod's own ghostpreview system instead of coding it new for each stool (some still do that)
- Having a global spawn function for each SENT in wire_lib instead of coding it everytime again. (With duplicator support of course)
It also needs to stop sucking FPS like it was going out of style.
Good to hear that. But that were only a few examples. I really would like to meet some weekend in IRC, talk about who goes through e.g. Wire - Physics and optimizes the code. When we are about 7 people, we could do that only in one day.
A freshly coded candidate for Wire 2 is already in the works, but I guess it wouldn't hurt to fix the current one first. I can help if I have time.
If in doubt, stick your finger in it.
Don't you ... me, I get about 20 fps when looking at a simple wired turret :|...
Anyway, if you think the pod controller is bad, you should the a look at the adv. controller.
I'm currently working on a update for the "normal" controller, and will look into using hooks.[/b]
Really wish I could help you guys, but don't know LUA (yet).
Maybe by the time you make Wire 3 I can help, since I am starting on IT College to september.
Everything can be improved upon. Nothing is Perfect.
The only way to move forward, is to surpass what has already been done.
Creator of many things.
As far as I know, most of that stuff is made by "outsiders" hence the code can be pretty shoddy and the only time I've personally ever touched those files was to fix some bugs. And I'm not really sure if the developers are that interested in going in and editing those files, especially not for remove spaces and shortening variable names... because we really shouldn't destroy structure of the code just to squeeze out a few bytes. Possibly one could run them all through some processor that strips and compresses everything as a "separate download".
I've thought about writing some better specification for certain things as alot of things are pretty strangely implemented and designed. E.g. the beacon sensor and that stuff, why do you link it with right click and not a wire, that way we could link the laser pointer to a beacon sensor instead of creating another "laser pointer beacon sensor" stuff. But I'm up to my neck with other work and never thought more about it or put any more time into the expression gate v2 (which I've also intend to properly separate, so that you can use "expressions" in other STOOLs/SENTs by simply creating an instance).
But yeah, generic ghost preview etc would be nice, but someone has to do it, and personally I don't really have time.
EDIT: But I do support your opinion, some things needs alot of cleaning up.
Sounds like you are missing the models or is on a very shitty computer that would give you 25 FPS if you removed all the wire parts from the turret.Don't you ... me, I get about 20 fps when looking at a simple wired turret :|[/b]
.Sounds like you are missing the models or is on a very shitty computer that would give you 25 FPS if you removed all the wire parts from the turret.[/b]
Nah it doesn't appear to be missing any models, though I am over-exaggerating abit as this turret also used gcombat bits and a shitload of ammunition crates, but it was on a server so I don't quite see why it should kill my fps that badly.
I did compare the fps when looking at a simple wire setup(8 buttons, 8 xors, and 8 indicators)(40-ish), looking at a tank I built(40-ish), and looking at nothing(90). The map was freespace06_v2-1. I could upload them if you like. This is probably just going to come down to me being paranoid about stuff etc.
Well, the problem with the adv. pod controller is that i did what i could, I don't know LUA enough to make it any better, And i don't even know where to start with hooks. If anything, it's ITSBTH to blame for both, because i just added things to the code as best i could, usually a direct copy from more of his code. And besides, TAD2020 is supposed to be recoding the adv. controller anyways, to add vector support, and just plain tuning.
Bookmarks