Author Topic: !layout command, a server-side modification (version 4)  (Read 51823 times)

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
!layout command, a server-side modification (version 4)
« on: December 16, 2006, 04:46:25 am »
!layout Patch

The download for the layout patched QVM has been removed. It was buggy and not tested for usability. Please use the Risujin/Avenger's mod which includes the latest version of this patch:
http://www.tremulous.net/phpBB2/viewtopic.php?t=3014

Description

This server-side game patch adds the !layout command. It allows (level 5) admins to create new starting positions for buildables on every map. Buildable layouts are stored, per map, in 'layout-mapname.dat' files in the mod directory.

The following admin commands are introduced:
  • !layout edit -- Begin layout editing mode. During this mode, no damage can be dealt and all restrictions related to building are removed.
  • !layout clear [human|alien] -- Remove buildables from the map. The optional argument of alien/human allows you to remove only one team's buildables.
  • !layout save [name] -- Save the layout as 'name'. Without the name argument the last used name is used again.
  • !layout load [name] -- Load layout 'name'. Without the name argument the last used name is used again.
  • !layout remove [name] -- Delete layout 'name'.
  • !layout build (buildable) -- Build buildable in front of you. Works from

spectator mode too.
  • !layout place (buildable) (x) (y) (z) (p) (y) (r) -- Place a buildable at

absolute coordinates (x,y,z) with orientation (y,p,r).
  • !layout random -- Load a random layout.
  • !layout current -- Print the name of the current layout.
  • !layout finish -- Finish editing the layout.
The following cvars are introduced:
  • g_layoutEdit 0|1 -- Layout editing mode toggle.
  • g_layoutAuto 0|1 -- Automatically load a custom layout on map load.
The patch has some limitations. The patch does is not able to load buildables placed on walls or ceilings. Buildables placed too close together may not load correctly. There is currently no way to reload the original map layout without removing all custom layouts.

This patch also removes a spurious srand() call in G_RunFrame() which was causing g_layoutAuto to load the same layout every time.

Credit for the original idea goes to vcxzet:
http://www.tremulous.net/phpBB2/viewtopic.php?t=2832

A mirror of the patch file:
http://www.missirina.com/risujin/tremulous/layout/layout-svn872-4.patch

This patch is on bugzilla:
https://bugzilla.icculus.org/show_bug.cgi?id=2973

rasz_pl

  • Guest
!layout command, a server-side modification (version 4)
« Reply #1 on: December 16, 2006, 05:12:04 am »
go back here and fix the links? :)

btw devs apparently dont give the F(udge) about the layout idea, ZERO answer after my PMs

daenyth

  • Posts: 230
  • Turrets: +21/-26
!layout command, a server-side modification (version 4)
« Reply #2 on: December 16, 2006, 06:37:27 am »
So, anyone hosting the layout patch on a non-Risu's Balance Mod server?
Quote from: Bullislander05
It's like trying to take apple seeds out of a zebra to plant a giraffe tree.

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #3 on: December 16, 2006, 07:43:41 am »
Quote from: "rasz_pl"
go back here and fix the links? :)

btw devs apparently dont give the F(udge) about the layout idea, ZERO answer after my PMs

learn to use irc. they are mostly on tremulous irc channel and answer your questions
also ask before entering bug reports to bugzilla ;) (on irc)

@Risujin
It was too good to be true :(

raf

  • Posts: 75
  • Turrets: +0/-0
!layout command, a server-side modification (version 4)
« Reply #4 on: December 16, 2006, 10:19:47 am »
http://www.missirina.com/risujin/tremulous/layout/layout-872-1.pk3

it works ;-) have a look at this vxctzrethhhhhf :-)

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #5 on: December 16, 2006, 10:21:04 am »
Quote from: "raf"
http://www.missirina.com/risujin/tremulous/layout/layout-872-1.pk3

it works ;-) have a look at this vxctzrethhhhhf :-)

I dont want binaries

raf

  • Posts: 75
  • Turrets: +0/-0
!layout command, a server-side modification (version 4)
« Reply #6 on: December 16, 2006, 10:31:19 am »
yeah keep crying :-) i want the source, too  :-P
but it looks nice

@ris: as a suggestion:
separating the layouts by teams would be nice so you could mix your different layouts
(of course you would have to add some func that checks whether A and H layout do overlap)

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #7 on: December 16, 2006, 10:49:21 am »
Quote from: "raf"
yeah keep crying :-) i want the source, too  :-P
but it looks nice

@ris: as a suggestion:
separating the layouts by teams would be nice so you could mix your different layouts
(of course you would have to add some func that checks whether A and H layout do overlap)

this may cause problems

so far this looks cool
i loved the editing mod
(but all structures can be combined in one menu . no necessary though)
save layout output is strange, delta is 0 0 0 for all (not very important)
load layout has some cool crashing effect
I still think of /fly command

OK thanks I will b more happy if you  give the patch file

raf

  • Posts: 75
  • Turrets: +0/-0
!layout command, a server-side modification (version 4)
« Reply #8 on: December 16, 2006, 11:06:50 am »
damn :-/
if you pack buildings to tight they won't get restored on load

/edit
try loading this layout (was created with ckit ;-) )
(it won't load medi and few turrets )
Code: [Select]
ex {
  acid_tube -1904.000000 -176.000000 -112.875000 0.000000 180.000000 0.000000
  acid_tube -1904.000000 176.000000 -112.875000 0.000000 90.000000 0.000000
  mgturret 1890.000000 512.000000 37.000000 0.000000 434.000000 360.000000
  arm 1748.000000 460.000000 30.000000 0.000000 446.000000 360.000000
  telenode 1611.000000 343.000000 21.000000 0.000000 518.000000 360.000000
  mgturret 1893.000000 456.000000 37.000000 0.000000 436.000000 360.000000
  mgturret 1609.000000 275.000000 37.000000 0.000000 536.000000 360.000000
  acid_tube -1680.000000 -336.000000 31.125000 0.000000 0.000000 0.000000
  acid_tube -1712.000000 -176.000000 -112.875000 0.000000 90.000000 0.000000
  acid_tube -1712.000000 176.000000 -112.875000 0.000000 180.000000 0.000000
  eggpod -1856.000000 448.000000 31.125000 0.000000 405.000000 0.000000
  eggpod -1728.000000 320.000000 31.125000 0.000000 405.000000 0.000000
  overmind -1744.000000 448.000000 31.125000 0.000000 45.000000 0.000000
  medistat 1823.000000 455.000000 24.000000 0.000000 460.000000 360.000000
  mgturret 1678.000000 299.000000 37.000000 0.000000 521.000000 360.000000
  reactor 1664.000000 448.000000 31.125000 0.000000 0.000000 0.000000
  mgturret 1681.000000 349.000000 37.000000 0.000000 503.000000 360.000000
  acid_tube -1896.000000 -304.000000 31.125000 0.000000 270.000000 0.000000
  mgturret 1734.000000 388.000000 37.000000 0.000000 469.000000 360.000000
  mgturret 1784.000000 393.000000 37.000000 0.000000 441.000000 360.000000
  mgturret 1890.000000 395.000000 37.000000 0.000000 432.000000 360.000000
  mgturret 1860.000000 214.000000 37.000000 0.000000 334.000000 360.000000
}

/e2 you seem to lose precision somewhere, most values look as if you casted them to int at some point
source would be nice ;-)

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #9 on: December 16, 2006, 11:20:10 am »
if some1 stands on the spawn place it wont work either

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
!layout command, a server-side modification (version 4)
« Reply #10 on: December 16, 2006, 04:43:19 pm »
Ok, the source is up now. I have a bad habit of adding "svn" to patch names but not to the pk3 names so one or the other link is broken when I forget. :D

Word of warning, the patch adds a full 500+ lines of code to g_admin.c.

Quote from: "vcxzet"
separating the layouts by teams would be nice so you could mix your different layouts

Easily doable but overlapping bases is too much of a hassle. The mod is supposed to work by randomly loading a layout when the game starts so if it randomly chooses incompatible bases, bad things happen.


Quote from: "vcxzet"
(but all structures can be combined in one menu . no necessary though)

The menus are clientside. I can do this in Balance mod though. :D

Quote from: "vcxzet"
save layout output is strange, delta is 0 0 0 for all (not very important)

I'll explain. YOU CANNOT PUT BUILDINGS ON CEILINGS. So please, don't try. Everything falls to the floor. I couldn't figure out how to get the damn buildings to stick to walls/ceilings ... it seems that G_buildItem uses the player's position to apply delta to the buildable so thats what that was about ... but it doesnt tell you anything later on. If anyone knows whats up with that, please patch.

Quote from: "vcxzet"
load layout has some cool crashing effect

Unintentional but hillarious. :D

Quote
I still think of /fly command

You can build from spectator mode. Ever had a really good game of humies vs aliens and aliens loose all their eggs, deconned maybe? Turn on layout edit mode and put down an egg using '!build eggpod', it works like normal build and even in spectator mode.

Quote from: "vcxzet"
if some1 stands on the spawn place it wont work either

We could killbox the spawn area. I don't know how and didn't want to mess with it for the moment. The mod uses the game's own building spawning code to do the work so it would be messy.

Quote from: "raf"
/e2 you seem to lose precision somewhere, most values look as if you casted them to int at some point
source would be nice ;-)

I didn't cast nuthin (see the .875 values...) although the game might. All values are taken direct to and from vec3_t's.

IJsje

  • Posts: 58
  • Turrets: +1/-1
!layout command, a server-side modification (version 4)
« Reply #11 on: December 16, 2006, 05:29:48 pm »
If you save it to a text file you lose precision in the base 2 to base 10 conversion. Use a hex format or something. Or multiply by some constant so that there are no floating point values.

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #12 on: December 16, 2006, 05:42:25 pm »
Quote from: "Risujin"
Ok, the source is up now. I have a bad habit of adding "svn" to patch names but not to the pk3 names so one or the other link is broken when I forget. :D

Word of warning, the patch adds a full 500+ lines of code to g_admin.c.

Quote from: "vcxzet"
separating the layouts by teams would be nice so you could mix your different layouts

Easily doable but overlapping bases is too much of a hassle. The mod is supposed to work by randomly loading a layout when the game starts so if it randomly chooses incompatible bases, bad things happen.

I didnt say that grrrr

Timbo

  • Administrator
  • Posts: 447
  • Turrets: +155/-161
!layout command, a server-side modification (version 4)
« Reply #13 on: December 16, 2006, 05:50:04 pm »
Quote from: "rasz_pl"
go back here and fix the links? :)

btw devs apparently dont give the F(udge) about the layout idea, ZERO answer after my PMs


Lose the attitude please.

robug

  • Posts: 50
  • Turrets: +0/-0
!layout command, a server-side modification (version 4)
« Reply #14 on: December 16, 2006, 05:53:43 pm »
Quote from: "daenyth"
So, anyone hosting the layout patch on a non-Risu's Balance Mod server?



Its on yaknet balance now...  Have fun

Thanks  Ris

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
!layout command, a server-side modification (version 4)
« Reply #15 on: December 16, 2006, 06:50:56 pm »
Quote
If you save it to a text file you lose precision in the base 2 to base 10 conversion. Use a hex format or something. Or multiply by some constant so that there are no floating point values.

If there was percision loss we'd be seeing values like 3.812635 ... the numbers end cleanly with zeroes and are human-readable (no floating point hex is NOT human readable). Its fine.

Quote from: "Timbo"
Quote from: "rasz_pl"
btw devs apparently dont give the F(udge) about the layout idea, ZERO answer after my PMs


Lose the attitude please.

Yeah I don't think Timbo is interested in any feature-modifications right now. He's either aiming for a bugfix release or thinks Trem is fine as it is.

Quote
Its on yaknet balance now... Have fun

EDIT: robug, you dropped the pk3 in the balance folder. I tried your server and it works fine, only problem is that it overrides the Balance game.qvm and you dont get many of the Balance mod features! I will cook up rev 11 with the layout patch for you.

Also, I just realized, to prevent a client download, you do NOT want a pk3 but rather a vm/game.qvm (just unzip it out of the pk3).

daenyth

  • Posts: 230
  • Turrets: +21/-26
!layout command, a server-side modification (version 4)
« Reply #16 on: December 16, 2006, 11:01:01 pm »
Quote from: "robug"
Quote from: "daenyth"
So, anyone hosting the layout patch on a non-Risu's Balance Mod server?



Its on yaknet balance now...  Have fun

Thanks  Ris


My point was that I'd like to try it out on a server that is NOT running balance mod. I'll check it out though, perhaps I misunderstood. Correct me if that's the case.
Quote from: Bullislander05
It's like trying to take apple seeds out of a zebra to plant a giraffe tree.

robug

  • Posts: 50
  • Turrets: +0/-0
!layout command, a server-side modification (version 4)
« Reply #17 on: December 17, 2006, 06:22:39 am »
Quote from: "daenyth"
Quote from: "robug"
Quote from: "daenyth"
So, anyone hosting the layout patch on a non-Risu's Balance Mod server?



Its on yaknet balance now...  Have fun

Thanks  Ris


My point was that I'd like to try it out on a server that is NOT running balance mod. I'll check it out though, perhaps I misunderstood. Correct me if that's the case.


No I misunderstood.  
Did not fully read/comprehend your post.  Sorry.

I would aslo like to see this option for creating better default base locations (transit for one) in un moded trem.  Or maybe just the ability to load new layouts on a given map while disabling the !layout command during normal play as I see HUGE potential for admin abuse.

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
!layout command, a server-side modification (version 4)
« Reply #18 on: December 17, 2006, 06:44:49 am »
Quote from: "robug"
I would aslo like to see this option for creating better default base locations (transit for one) in un moded trem.  Or maybe just the ability to load new layouts on a given map while disabling the !layout command during normal play as I see HUGE potential for admin abuse.

!layout command puts the game in edit mode. There are messages indicating when its enabled and disabled.

I put a link for the layout game.qvm above, it contains TJW's admin and the latest SVN. You can run this on base Tremulous servers and it does not require a download. Make a vm folder in base, drop the qvm in there.

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #19 on: December 17, 2006, 08:48:44 am »
looks like there is some precision error :(
this is mainly risujin's original patch just output format for float changed to
%.3f (something out of my ass :) I tried many times and it was all 0 after 3rd place -> N.xxx000)
and changed ent->s.origin to ent->s.pos.trBase
they must be same though :/
http://www.mercenariesguild.net/tremx/layout.patch

edit: also removed backporting part so it is against 872

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
!layout command, a server-side modification (version 4)
« Reply #20 on: December 17, 2006, 06:21:46 pm »
Quote from: "vcxzet"
looks like there is some precision error :(

But you ... LOWERED precision with %.3?? Anyone who decides to use this, your layout files will still be compatible with the other patch.

Quote from: "vcxzet"
and changed ent->s.origin to ent->s.pos.trBase
they must be same though :/

Did this help?

Quote from: "vcxzet"
edit: also removed backporting part so it is against 872

Thanks.

What I really want for christmas is for this thing to save buildables stuck to walls.

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #21 on: December 17, 2006, 06:48:09 pm »
Quote from: "Risujin"
Quote from: "vcxzet"
looks like there is some precision error :(

But you ... LOWERED precision with %.3?? Anyone who decides to use this, your layout files will still be compatible with the other patch.


no after 3rd digit it is all zero
and looks like that way I gained some thing
(but still cant spawn too near buildables :/)

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
!layout command, a server-side modification (version 4)
« Reply #22 on: December 20, 2006, 11:44:21 pm »
New version. I cleaned this thread up a bit. Please don't use this with Balance mod! Rev. 12 will have this patched in.

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #23 on: December 21, 2006, 04:17:50 pm »
omg whatever I do they fall to the ground
so far I can just build on walls but not on ceilling

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
!layout command, a server-side modification (version 4)
« Reply #24 on: December 21, 2006, 05:02:24 pm »
Quote from: "vcxzet"
omg whatever I do they fall to the ground
so far I can just build on walls but not on ceilling

Look in G_admin_layout_place, see if you can find a way to get them to stay...

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #25 on: December 23, 2006, 12:04:36 pm »

vcxzet

  • Guest
!layout command, a server-side modification (version 4)
« Reply #26 on: December 23, 2006, 12:43:57 pm »
the above pic is irrelevant :P

http://www.mercenariesguild.net/tremx/layout_test.patch

this is a fixed(?) patch::
you can build on ceiling and walls and save it then it will load
it can load buildables even if they are too near however some will become invisible (ie build 3 acid tubes next to eachother and save and load only one will be visible but if you decon one 2 will be visible :x )

you cant build turrets on ceiling :P

you can place more than 1 reactor/OM by editing the file
you can make bases that costs more build pts
(ie set build points to 300 build the base save and it will load for max 100 bps but you need to decon 208 to build an acid tube somewhere else)

Glunnator

  • Posts: 865
  • Turrets: +5/-6
!layout command, a server-side modification (version 4)
« Reply #27 on: December 23, 2006, 12:52:49 pm »
This looks so funny....

So, a possibility would be, when playing a lolgame*,
Would be building an alien base with 10 eggs, 1 acid tube, and like 15 OM's for defence, instead of acids.... LAWLITY :D


*: A lolgame. What is a lolgame? A game where everyone messes about. never really attacks enemy base but makes really funny mess building on ridiculous places. example: building eggs & spawns in a mass in one corner, building tons of boosters and medis, writing 'LOL' on the wall with trappers. (really funny when you get a hummie in the middle of that. LOL)

Basically, ignoring basic rules and goals of the game, and just having fun with your friends  8)

Quote from: (Cebt)Glunnator
HAVE FUN PPL, IT'S THE MEANING OF LIFE TO LOOK AT THE BRIGHT SIDE OF IT! ;)

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
!layout command, a server-side modification (version 4)
« Reply #28 on: December 23, 2006, 06:05:24 pm »
Quote from: "vcxzet"
http://www.mercenariesguild.net/tremx/layout_test.patch

Did you fix that bug where it stuck your normal grounded turrets and reactor to the wall?

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
!layout command, a server-side modification (version 4)
« Reply #29 on: December 24, 2006, 05:54:33 am »
Updated with version 4 of the patch and game.qvm. Watch for this in revision 13. A good number of improvements, inculding bug fixes and building on ceilings/walls. Please see bugzilla for details.