• Space Build(Chapter 1: The Solar System!)
    1,419 replies, posted
Oh my flying assault monkeys. This is, beautiful. (Winged monkeys nod sagely) Lets go, men! Er, monkeys! Charge!
I'm going to fly to the sun and build a sun base
[QUOTE=Sneakytouch]I'm going to fly to the sun and build a sun base[/QUOTE] good luck .... That gives me a brilliant idea for a space build map.
Ohhhh fuck. I flew in to jupiter. I just fucking hated that. I hate gas giants! Good map.
Damn, Jinto, that map kicks ass! I remember flying my ship, and landing it's back half in a lava pool, entirely destroying most of my life support! D: Great map though!
o dear lord and all that is holy.....this is the grail of all spacebuild maps (no ofence shanjag) ALL BOW DOWN TO JINTO! OUR NEW LORD AND SAVIOR!!! but on a more serious note, this calls for some serious exploration, i think a large scale invasion is in order >:)
Jinto, is that a X-Com avatar? Becauce that is/was one of the best TBS games ever.
[QUOTE=edberg]What the fuck!? If I had known that I wouldn't have used those damn fusion reactors, I ran out of coolant when I went to venus, I started heading back to earth and then my fucking ship exploded! What the fuck?! God a warning would be nice. :argh: God I worked on that thing for like 2 hours. :([/QUOTE] Actually, I told you that they exploded and we spent about 30 minutes trying to get them to explode. So stop lying sir.
I have read a lot of requests for weapons, and most of them sound kinda like they would be kinda tricky to code. I believe that my idea would be fairly easy to implement. First, the laser. Malawar's launcher (it can be made to fire any entity) could be used as the base for the lasers. Someone could do a custom entity that looks like a laser (see below) and dissolves the first prop it touches, like the combine energy ball. This way, you could use layers of standard props as hull plating if you don't like shields. As for the shields, different shapes and sizes of the below design could be used. If a laser hit it, the laser could disappear and your energy would drop a little bit. [img]http://img406.imageshack.us/img406/5327/laserandshieldconceptxj8.jpg[/img]
I tried to install these scripts, and after a long hastle of getting all of the life support, resource shit, and spacebuild itself to finally run along side my edited sandbox, I find out that it eats up about 80% CPU with 12 players, with ABSOLUTELY NO PROPS WHATSOEVER. Not only that, but the dedicated server's frame rate was in the gutter. I looked at the code and it was such a mess that I'm not surprised. CLEAN UP YOUR CODE. Rebuild it or make a new version, it's impossible to play with more than a few people and props. Suggestions: * Get rid of the ropes when things are linked. Find another server-friendly way to do this so. They lag like hell when there's a lot of them. I removed them myself and noticed a nice performance increase. * Use less networked variables, especially on players. Other players don't need to know about eachother's air. At one point there were so many that it simply wasn't sending any more and we saw things with 0 resources when they actually had some. * You can substitute all the find in spheres with scripted trigger entities, atleast for the planets. One ENT:StartTouch() over multiple nested for loops every second. * The HUD that came with Life Support assumes that you have eHud, wich I don't think everyone has. The non-eHUD version of the client-side script is drawn off the screen and doesn't update. * The code itself is just plain messy and not server-friendly. Call it a rant if you want, but I was looking forward to playing it without having to go in the script and practically rebuild it.
Awesome gamemode, works great on my server, thanks
[QUOTE=JetBoom] * Get rid of the ropes when things are linked. Find another server-friendly way to do this so. They lag like hell when there's a lot of them. I removed them myself and noticed a nice performance increase. * Use less networked variables, especially on players. Other players don't need to know about eachother's air. At one point there were so many that it simply wasn't sending any more and we saw things with 0 resources when they actually had some. * You can substitute all the find in spheres with scripted trigger entities, atleast for the planets. One ENT:StartTouch() over multiple nested for loops every second. * The HUD that came with Life Support assumes that you have eHud, wich I don't think everyone has. The non-eHUD version of the client-side script is drawn off the screen and doesn't update. * The code itself is just plain messy and not server-friendly. Call it a rant if you want, but I was looking forward to playing it without having to go in the script and practically rebuild it.[/QUOTE] Ropes will be removed the moment a Client-Side Beam Library is provided by Tad2020. I heard this request the first time and am just as anxious to see the ropes replaced as the next guy. I'm not sure how checking 4 variables on each player once every second is going to eat up 80% CPU. Aside from using a few questionable methods picked up from other addons, I'd say most of it is pretty efficient. I'll try switching to UserMessages, thanks for pointing out the NetworkedInt issue, which is probably the reason why it lagged with that many players. It has been my experience that massive trigger brushes come with a hidden penalty, even in single-player there was a remarkable decrease in FPS, which is why I switched to the global objects loop. Bounding Sphere is a lot more efficient than per-poly collision checks. The eHud Support was designed to be disabled if eHud is not detected. I was given instructions on how to do this through a PM from Night-Eagle. [b]Edit:[/b] Wow, that helped a lot already. All NetworkedInts replaced with UserMessages directed at individual players, testing it on my server now and net_graph 2 is looking a lot better! And here is the update: [url=http://www.garrysmod.org/downloads/?a=view&id=8273][img]http://www.garrysmod.org/img/?t=dll&id=8273[/img][/url] Ropes will be gone as soon as possible, I promies! [b]Edit:[/b] Also, its up on Garrysmod.org finally! [url=http://www.garrysmod.org/downloads/?a=view&id=8276][img]http://www.garrysmod.org/img/?t=dll&id=8276[/img][/url]
I'm having a problem. Locally in space and on other planets I'm not getting the suit working. Its set to the spacebuild game mode and the console says as much after I've connected to my local server. I have all of the Life Support Items available to me and they all connect up and work, I just don't seem to be able to get a suit from the dispenser and Atmospheres don't seem to effect me. This has only happened since upgrading to Life Support 1.7 Can anyone help me with this?
Can someone link me to the music from the trailer? -Thanks in advance!
Ok the various gravity's work however Nothing as far as the suit works. The dispenser won't dispense it and different atmospheres don't effect me.
[QUOTE=ijakings]Ok the various gravity's work however Nothing as far as the suit works. The dispenser won't dispense it and different atmospheres don't effect me.[/QUOTE] It's not just a map, it's a gamemode. Meaning where it says "Default" as gamemode you need to select "Spacebuild".
[QUOTE=Shanjaq]Ropes will be removed the moment a Client-Side Beam Library is provided by Tad2020. I heard this request the first time and am just as anxious to see the ropes replaced as the next guy. ... Ropes will be gone as soon as possible, I promies![/QUOTE] I have got all the explosions and major bugs out. There were some that would cause the StarGates to explode after loading a map, then later another one that would cause the sky to bleed up through the ground. Once I get it fully working for wire (it needs to be a little more complex with the defined I/Os), then I will convert it for Life Support. Shanjaq or I will have to add a checks to limit the distances links can be stretched, cause you shouldn't be able run plumbing from Earth to Mars and back.
I love space build, but are you planning on adding more planets or adding special space weapons like disable all air supply, or EMP missiles that stop all energy on a ship for a certain ammount of time?
Yeh i know I've set the mode to spacebuild. Ok problem solved. The latest game mode for spacebuild didn't extract properly hence It not working right.
Shanjaq AND Jinto is my GODS!!!!!! (Garry too) Bless you! you showed me that Garrys Mod will live FOREVER!!!!! Bless you!
[QUOTE=BrainDeath]Can someone link me to the music from the trailer? -Thanks in advance![/QUOTE] I think it was called under the asteroids or something. I think it's from EVE.
What SWEP/weapon/thing was that fireball cannon used in the video?
Have a better glitch. I was building a station in Solar, when the mother of all lags hit. It said Warning: Connection Problem and all. Came back, but ALL the Support equipment turned into stargates. Diffrent time same style, some phx plates turned into fans. But here's the thing, no one but me could see the changes. Is my Gmod taking drugs? And the last, I don't know who did this but the 9, 6 and 3 num keys stick in game. Not the keyboard, it's in game all right.
[QUOTE=Naes Draw]Have a better glitch. I was building a station in Solar, when the mother of all lags hit. It said Warning: Connection Problem and all. Came back, but ALL the Support equipment turned into stargates. Diffrent time same style, some phx plates turned into fans. But here's the thing, no one but me could see the changes. Is my Gmod taking drugs? And the last, I don't know who did this but the 9, 6 and 3 num keys stick in game. Not the keyboard, it's in game all right.[/QUOTE] If your keys are sticking you may not have gotten one of the last gmod updates.
You refer to players as player.Entity. Using player is fine. Here is the best way you can do updating to suits. Rec. Filters are not needed if you're only sending it to one player, just use the player object itself: [lua] function Suit_Update( s ) if s.temperature < FairTemp then umsg.Start("LS_umsg", s.player) umsg.Short(s.habitat + 1) umsg.Short(s.air) umsg.Short(s.temperature) umsg.Short(s.energ) umsg.End() else umsg.Start("LS_umsg", s.player) umsg.Short(s.habitat + 1) umsg.Short(s.air) umsg.Short(s.temperature) umsg.Short(s.coolant) umsg.End() end end [/lua] Instead of doing 3 different for loops for each type of vehicle, use this code wich will just add all 3 together in one loop: [lua] for _, ent in pairs(ents.FindByClass("prop_vehicle_*")) do end [/lua] LSWaterCheck() is called inside a player.GetAll() for loop. I'm assuming it should be called afterwards and was put there by mistake. Somewhere around the beggining of the for loop, you have a big chunk of 'or' to find out weather or not to do life support checks on someone. It can be reduced to this: [lua] if pPlayer.suit.inwater == 1 or pPlayer.suit.temperature != FairTemp or pPlayer.suit.atmosphere != 1 then [/lua] 'found' is not used in any part of the file, but it is declared every frame. [lua] local found [/lua] [lua] function Life_Support_Update () if CurTime() > (NextUpdateTime or 0) then [/lua] Can be reduced to... [lua] NextUpdateTime = 0 function Life_Support_Update () if CurTime() > NextUpdateTime then [/lua] Also, true and false is IMO, a better option to use than == 0, ~=nil, and == 1. Nested if loops are no longer needed in new versions of Lua. If you have a variable and it is nil, this following code will not cause an error: [lua] if nilvariable and nilvariable == 5 then Msg(nilvariable) else Msg("nil. Stopping code.\n") end ... blah blah blah ... [/lua] as opposed to: [lua] if nilvariable then if nilvariable == 5 then Msg(nilvariable) end end ... blah blah blah ... [/lua] All entities in FindInSphere and such are always valid, as far as I have found in all of my scripts with FindInSphere's. IsValid() will always be true, so isn't needed. Water level can be found out with [lua] Ent:GetWaterLevel() [/lua] instead of a trace. It will return a value between 0 and 4 depending on how deep the entity is under. 0 being no water and 4 being completely under. I used that instead of a trace. Overall, this is what I have come up with as an optimization for the biggest chunk of Life Support code. [lua] local function Life_Support_Spawn(pl, attacker, inflictor) Suit_Reset(pl.suit) end hook.Add("DoPlayerDeath", "LS_Spawn", Life_Support_Spawn) NextUpdateTime = 0 function Life_Support_Update () if CurTime() > NextUpdateTime then NextUpdateTime = CurTime() + 1 for _, check in pairs(ents.FindByClass("prop_vehicle_*")) do if not check.environment then LS_RegisterEnt(check) RD_AddResource(check, "air", 0) RD_AddResource(check, "energy", 0) RD_AddResource(check, "coolant", 0) end end for _, pPlayer in pairs(player.GetAll()) do local entpos = pPlayer:GetPos() if pPlayer:GetWaterLevel() > 3 then pPlayer.suit.inwater = 1 else pPlayer.suit.inwater = 0 end if pPlayer.suit.inwater == 1 or pPlayer.suit.temperature != FairTemp or pPlayer.suit.atmosphere != 1 then local airsafe = 0 local heatsafe = 0 local crushsafe = 0 local pod = pPlayer:GetParent() if pod:IsValid() and pod.environment and pod.environment.habitat == 0 then local inc = Air_Increment local avail = RD_GetResourceAmount(pod, "air") if pPlayer.suit.air < 100 and avail >= 100 - pPlayer.suit.air then pPlayer.suit.air = 100 inc = inc + (100 - pPlayer.suit.air) end if avail >= inc then RD_ConsumeResource(pod, "air", inc) airsafe = 1 elseif avail > 0 then RD_ConsumeResource(pod, "air", avail) pPlayer.suit.air = pPlayer.suit.air + avail end if pod.environment.temperature < FairTemp then local e_dec = 0 if pod.environment.atmosphere > 0 then e_dec = math.ceil(Energy_Increment * (4 - (pod.environment.temperature / 72))) else e_dec = 2 end if RD_GetResourceAmount(pod, "energy") > e_dec then RD_ConsumeResource(pod, "energy", e_dec) heatsafe = 1 end elseif pod.environment.temperature > FairTemp then local c_dec = math.ceil(Coolant_Increment * ((pod.environment.temperature - FairTemp) / 72)) if RD_GetResourceAmount(pod, "coolant") > c_dec then RD_ConsumeResource(pod, c_dec) heatsafe = 1 end end crushsafe = 1 end if airsafe == 0 then for _, ent2 in ipairs(ents.FindByClass("air_exchanger")) do if (ent2.Active or 0) == 1 and ent2:GetPos():Distance(entpos) < (ent2.range or 0) then if ((ent2.running or 0) == 1) then airsafe = 1 end crushsafe = 1 break end end end if heatsafe == 0 then for _, ent2 in ipairs(ents.FindByClass("heat_exchanger")) do if (ent2.running or 0) == 1 and ent2:GetPos():Distance(entpos) < (ent2.range or 0) then heatsafe = 1 break end end end if airsafe == 0 or heatsafe == 0 then for _, ent2 in ipairs(ents.FindByClass("climate_control")) do if ent2.Active == 1 and ent2:GetPos():Distance(entpos) <= (ent2.range or 0) then if (ent2.heat_running or 0) == 1 then heatsafe = 1 end if (ent2.air_running or 0) == 1 then airsafe = 1 end crushsafe = 1 end end end if airsafe == 0 and (pPlayer.suit.habitat == 0 or pPlayer.suit.inwater) then hfix = 1 Air_Update( pPlayer.suit ) end if heatsafe == 0 and pPlayer.suit.temperature != FairTemp then tfix = 1 Temperature_Update(pPlayer.suit) end if crushsafe == 0 and pPlayer.suit.atmosphere != 1 then Pressure_Update(pPlayer.suit) end else if pPlayer.suit.air < 100 then pPlayer.suit.air = 100 end if hfix == 1 then hfix = 0 end if tfix == 1 then tfix = 0 end end if pPlayer.suit.air > 0 and pPlayer.suit.recover > 0 then if pPlayer:Health() + 5 >= 100 then pPlayer:SetHealth(100) pPlayer.suit.recover = 0 else pPlayer:SetHealth(pPlayer:Health() + 5) pPlayer.suit.recover = pPlayer.suit.recover - 5 end end if pPlayer:Alive() then Suit_Update(pPlayer.suit) end end LSWaterCheck() end end hook.Add("Think", "Life_Support_Update", Life_Support_Update) [/lua] Just trying to get it optimized and running.
[QUOTE=JetBoom]You refer to players as player.Entity. Using player is fine. Here is the best way you can do updating to suits. Rec. Filters are not needed if you're only sending it to one player, just use the player object itself: [/QUOTE] Also, I've found that if player is nil, the umsg will send to all players. Thought I'd mention that, I've not seen it documented anywhere.
Awesome gamemode, i'm rather addicted to it right now. My only request is a type of awesome but not incredibly cheap weapon kind of thing that affects systems somehow, and requires varying amounts of energy, or the power fluxuates depending on energy to it.
[QUOTE=Draicia]I think it was called under the asteroids or something. I think it's from EVE.[/QUOTE] Thanks very much, I knew it was from eve but not which track.(Check the youtube comments)
The song is "Below the Asteroids." You can download it off of the EVE website. When you choose a song you like just right click and use "save target as..." [url]http://www.eve-online.com/download/music/[/url]
I know.
Sorry, you need to Log In to post a reply to this thread.