Forum

Tutorial: Rotating Brush Models for QuakeWorld

Post tutorials on how to do certain tasks within game or engine code here.

Moderator: InsideQC Admins

Postby avirox » Fri Jan 15, 2010 12:36 pm

Much as pointer entities do work essentially the same way, I kind of see it the way goldenboy does in that origin brushes really are an established standard for mappers these days. Even source engine games still rely on them, and many other engines as well. Either choice "works", but I think we should give mappers the option to choose at the very least.

[/my 2 cents]
avirox
 
Posts: 137
Joined: Wed Aug 16, 2006 3:25 pm

Postby Urre » Fri Jan 15, 2010 1:07 pm

I'm with you on this now, only because it's actually broken in its current form. If a compiler dev fixes their compiler to support solid rotating brushes, they might as well add origin brush support while they're at it. But that's the only reason really :P Mappers need to be able to adapt as well, considering a very similar way to do things exists already. LordHavoc's compiler letting you manually specify an origin also seems a very cool way to do it, in my opinion. Remember, I'm also a mapper, that's where I started my modding career. Not only do I know how it works, I know how it feels to map :) I actually miss it lots.
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby Baker » Fri Jan 15, 2010 1:50 pm

Does someone have a compiled bsp from this that works in DarkPlaces that supports this? And if so, can they post a download link?

Such a map would be a good testing tool for others to ensure proper engine support.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby goldenboy » Fri Jan 15, 2010 2:19 pm

OK, when I compile my testmap (hiprot_3 with the rotate_object and info_rotate) with the new hmap2, the brush doesn't rotate and is nonsolid in DP...?
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Postby LordHavoc » Fri Jan 15, 2010 2:39 pm

goldenboy wrote:OK, when I compile my testmap (hiprot_3 with the rotate_object and info_rotate) with the new hmap2, the brush doesn't rotate and is nonsolid in DP...?


What quakec code are you using for it?

What I did was change it to a func_wall and remove the info_rotate, then I set the origin manually in the func_wall (matching the info_rotate I removed), then I set these fields:
"nextthink" "999999999"
"avelocity" "0 0 90"

And it rotates, such that I can jump onto it and ride on it a bit before falling off the other side.
LordHavoc
 
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA

Postby goldenboy » Fri Jan 15, 2010 3:07 pm

Nevermind, I was testing it with the RMQ progs, which contains the hipnotic code...

Anyway, this:

What I did was change it to a func_wall and remove the info_rotate, then I set the origin manually in the func_wall (matching the info_rotate I removed), then I set these fields:
"nextthink" "999999999"
"avelocity" "0 0 90"


is not user friendly. Either targetting a point entity or origin brushes would be much preferred.

Can you give me a QuakeC example entity like for example a func_rotate or something similar? Ideally, what we would end up with is an example mod (progs.dat, source, .def file and example map).
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Postby LordHavoc » Fri Jan 15, 2010 3:11 pm

goldenboy wrote:Nevermind, I was testing it with the RMQ progs, which contains the hipnotic code...

Anyway, this:

What I did was change it to a func_wall and remove the info_rotate, then I set the origin manually in the func_wall (matching the info_rotate I removed), then I set these fields:
"nextthink" "999999999"
"avelocity" "0 0 90"


is not user friendly. Either targetting a point entity or origin brushes would be much preferred.

Can you give me a QuakeC example entity like for example a func_rotate or something similar? Ideally, what we would end up with is an example mod (progs.dat, source, .def file and example map).


I can not, because the hipnotic rotate code isn't solid, and you have to provide a spawn function for an entity for it to appear in the game at all, and I do not have the same spawn function here, I only tested what I could.

The target origin retrieval is only supported if the entity's name starts with rotate_ (for example rotate_object) so it can not work without a spawn function for that custom entity, and I can't easily test that.

I test with func_wall with an origin set manually for a reason :P
LordHavoc
 
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA

Postby goldenboy » Fri Jan 15, 2010 4:18 pm

OK. I don't really understand all this anymore, you guys might as well be speaking Suaheli. I want something that I can do in my map editor (in a painless way hopefully) that will give me a rotating door.

If you need me to do anything, just say so...

sigh...

only supported if the entity's name starts with rotate_


Why? That sounds like you're exploting some existing stuff in a hacky way. Can't we take this instead

http://www.quake-1.com/docs/quakesrc.org/129.html

including the QC example, and make it work?
Last edited by goldenboy on Fri Jan 15, 2010 4:25 pm, edited 1 time in total.
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Postby LordHavoc » Fri Jan 15, 2010 4:24 pm

goldenboy wrote:OK. I don't really understand all this anymore, you guys might as well be speaking Suaheli. I want something that I can do in my map editor (in a painless way hopefully) that will give me a rotating door.

If you need me to do anything, just say so...

sigh...


I was only clarifying that my test cases are different from your test cases, because you have a mod running and I do not, my test cases are to make sure that rotating brushes work, not that rotating doors work or any other higher-level concept.

Whether higher level stuff works is a matter of the QuakeC code, not the engine, and I'm judging purely on the engine side here, where I have confirmed the collisions work properly with an hmap2-compiled map.

I was saying that any further bugs need the assistance of a qc coder, not an engine debugging effort :)
LordHavoc
 
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA

Postby Baker » Fri Jan 15, 2010 4:27 pm

I have a 2 YouTube videos uploading showing the object rotating in DarkPlaces and I'll upload the source example of the map and the compiled bsp.

It rotates very nicely. I can stand on it.

Map source (220 version ... need to locate Scrama's 220 version --> standard .map converter):

Code: Select all
{
"classname" "worldspawn"
"classname" "worldspawn"
"sounds" "1"
"mapversion" "220"
"wad" "id_base.wad"
{
( -384 -384 320 ) ( -384 448 320 ) ( 384 448 320 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -384 448 288 ) ( -384 448 320 ) ( -384 -384 320 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 384 -384 288 ) ( 384 -384 320 ) ( 384 448 320 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 384 448 288 ) ( 384 448 320 ) ( -384 448 320 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -384 -384 288 ) ( -384 -384 320 ) ( 384 -384 320 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -384 448 288 ) ( -384 -384 288 ) ( 384 -384 288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
{
( -384 448 -320 ) ( -384 -384 -320 ) ( 384 -384 -320 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -384 -384 -288 ) ( -384 -384 -320 ) ( -384 448 -320 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 384 448 -288 ) ( 384 448 -320 ) ( 384 -384 -320 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -384 448 -288 ) ( -384 448 -320 ) ( 384 448 -320 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 384 -384 -288 ) ( 384 -384 -320 ) ( -384 -384 -320 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -384 -384 -288 ) ( -384 448 -288 ) ( 384 448 -288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
{
( -384 -384 288 ) ( -384 -384 -288 ) ( -384 448 -288 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -384 448 288 ) ( -384 448 -288 ) ( -352 448 -288 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -352 -384 -288 ) ( -384 -384 -288 ) ( -384 -384 288 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -384 -384 288 ) ( -384 448 288 ) ( -352 448 288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -384 448 -288 ) ( -384 -384 -288 ) ( -352 -384 -288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -352 448 288 ) ( -352 448 -288 ) ( -352 -384 -288 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
}
{
( 384 448 288 ) ( 384 448 -288 ) ( 384 -384 -288 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 352 448 -288 ) ( 384 448 -288 ) ( 384 448 288 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 384 -384 288 ) ( 384 -384 -288 ) ( 352 -384 -288 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 352 448 288 ) ( 384 448 288 ) ( 384 -384 288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 352 -384 -288 ) ( 384 -384 -288 ) ( 384 448 -288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 352 -384 288 ) ( 352 -384 -288 ) ( 352 448 -288 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
}
{
( -352 448 -288 ) ( 352 448 -288 ) ( 352 448 288 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -352 416 288 ) ( -352 448 288 ) ( 352 448 288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 352 448 -288 ) ( -352 448 -288 ) ( -352 416 -288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -352 416 -288 ) ( -352 448 -288 ) ( -352 448 288 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 352 448 288 ) ( 352 448 -288 ) ( 352 416 -288 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 352 416 -288 ) ( -352 416 -288 ) ( -352 416 288 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
}
{
( 352 -384 -288 ) ( -352 -384 -288 ) ( -352 -384 288 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 352 -384 288 ) ( -352 -384 288 ) ( -352 -352 288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -352 -352 -288 ) ( -352 -384 -288 ) ( 352 -384 -288 ) plat_top3 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -352 -384 288 ) ( -352 -384 -288 ) ( -352 -352 -288 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 352 -352 -288 ) ( 352 -384 -288 ) ( 352 -384 288 ) plat_top3 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -352 -352 -288 ) ( 352 -352 -288 ) ( 352 -352 288 ) plat_top3 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
}
}
{
"classname" "info_player_start"
"origin" "-256 -224 -192"
}
{
"classname" "func_wall"
"targetname" "rotator"
"nextthink" "999999999"
"avelocity" "0 90 0"
"origin" "0 0 0"
{
( -128 32 64 ) ( 128 32 64 ) ( 128 -32 64 ) cliff2_8 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -128 -32 -64 ) ( 128 -32 -64 ) ( 128 32 -64 ) cliff2_8 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -128 32 64 ) ( -128 -32 64 ) ( -128 -32 -64 ) cliff2_8 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 128 32 -64 ) ( 128 -32 -64 ) ( 128 -32 64 ) cliff2_8 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 128 32 64 ) ( -128 32 64 ) ( -128 32 -64 ) cliff2_8 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 128 -32 -64 ) ( -128 -32 -64 ) ( -128 -32 64 ) cliff2_8 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
}
}
Last edited by Baker on Fri Jan 15, 2010 4:32 pm, edited 1 time in total.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby goldenboy » Fri Jan 15, 2010 4:32 pm

Lord Havoc, I don't have to test using the RMQ mod. I accidentally did that out of habit. xavior, do you have some QC that I could plug into a mod to get rotating brushes working using a point entity to get the origin? Because that seems closest to what I need.

Baker: That is basically what LordHavoc said just more complicated, and I know that brushes rotate in DP in principle. I have a vid, too.
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Postby Baker » Fri Jan 15, 2010 4:52 pm

YouTube video (It's only 4 seconds long):

http://www.youtube.com/watch?v=Bke3wPWsH38

rotate.map + hmap2.exe + rotate.bsp: download (Works with a current version of DarkPlaces)

@gb: I hear you. I'm just doing what I can to help advance this. I'm not Mr. QuakeC. Note: from the video you'll see the brush is quite solid, in an older version of DP it wasn't solid.
Last edited by Baker on Mon Jan 18, 2010 1:19 pm, edited 1 time in total.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby r00k » Fri Jan 15, 2010 6:28 pm

i dont have time atm, but
void() rotator =
{
set a touch trigger,
update the nexthink,
check angle,
reset nexthink,
reset direction,
reset touch function.
}
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Baker » Mon Jan 18, 2010 1:36 am

Origin brush support is essentially having a brush in the world with the special name "origin" and then upon compile, that brush gets removed from the world and any entities targetted that entity get the center of that brush as an "origin" field.

Correct?

So LordHavoc sort of bypassed everything and went straight to the end result. Am I right so far?

Am thinking about taking a crack at adding this to aguirRe's txqbsp tomorrow if the time required is under 2 hours. I've done past homework on this, but maybe the difference might be this time is that I know more than before (I hope) and things are "sinking in".
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Baker » Mon Jan 18, 2010 1:24 pm

FitzQuake085 with rotating brush support: download

Sample rotating object (rotate.bsp and rotate.map compiled with LordHavoc's new version of hmap2): download

Rotation support (avelocity) added from this tutorial:

http://www.quake-1.com/docs/quakesrc.org/129.html
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

PreviousNext

Return to Programming Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest