Quake3World.com Forums
     Programming Discussion
        [ioq3]"Air Rippers" development


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: [ioq3]"Air Rippers" development

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 10-17-2013 04:39 AM           Profile Send private message  E-mail  Edit post Reply with quote


Hello !
Welcom to this new topic, that comes after two other long running ones, "6dof camera movement" and "looping square map". Both were actually covering the development of a game prototype using idTech 3, or actually the ioQuake 3 version.

First, let me sum up the game : What I want to do, or rather experiment, is transposing the gameplay of Vlambeer's Luftrauser game (the full version, "Luftrausers" should come out before the end of the year, I hope !) into a 3D first person shooter.

What is "Luftrauser" errrr "Air Rippers" ?
- You control a plane, with very simple mechanics : you can look in any direction [DONE], and a button pushes you forward (the "thruster").
-> When "thrusting", no gravity is applied, or very few, but the "mouse sensitivity" will be lower
-> When you're not "thrusting", you begin to free fall, with some inertia from your last thrusting direction, but the "mouse sensitivity" will be higher, so aiming at the enemies can be easier.

When your health goes under 0, your ship enters "kamikaze" mode, and with minimal air control you can try to crash in an enemy ship with extra damage.

Mouse-only game : move the mouse to look, left click to shoot, right click to "thrust" forward.

- The environment looks infinite, but actually loops [DONE]

- 2 categories of enemies : Planes and boats. They cruise towards you and shoot at you. Sub categories can be added : kamikaze jets, bombers, destroyers, aircraft carriers, whatever.

The final objective is to build a standalone game that looks finished :)

In this topic, I'll try to share my progress along the way :)

Right now, I'll be trying to create the player movement according to the plan. I already did a quick thing that turns on the "fly" powerup when you press "forwards", but the air control isn't really there.

I'm adding 2 new "Player Move" types : PM_PLANE and PM_KAMIKAZE. I think I'll base myself on the "spectator" mechanics ... I have to study a lot :)

I have a sound related question : I noticed some "start looping sound" and "stop looping sound" functions, and I'd like to play the rocket flying sound when the player is flying. How and where in the code should I do that ? in the client module, the game module, or the client game module ?

Thanks for reading !



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44131
PostPosted: 10-17-2013 05:48 AM           Profile   Send private message  E-mail  Edit post Reply with quote


You might want to take a look at the target_speaker entity (g_target.c). They can play looping sounds. There’s a bug in Q3 that prevents them from being toggled off though. To fix that in EntityPlus, I made the following change in cg_ents.c in the CG_EntityEffects( centity_t *cent ) function.

The original code is:

Code:
// add loop sound
   if ( cent->currentState.loopSound ) {
      if (cent->currentState.eType != ET_SPEAKER) {
         trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin,
            cgs.gameSounds[ cent->currentState.loopSound ] );
      } else {
         trap_S_AddRealLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin,
            cgs.gameSounds[ cent->currentState.loopSound ] );
      }
   }


And I added an else to that:

Code:
// add loop sound
   if ( cent->currentState.loopSound) {
      if (cent->currentState.eType != ET_SPEAKER) {
         trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin,
            cgs.gameSounds[ cent->currentState.loopSound ] );
      } else {
         trap_S_AddRealLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin,
            cgs.gameSounds[ cent->currentState.loopSound ] );
      }
   }
   else {
      trap_S_StopLoopingSound(cent->currentState.number);
   }


Can’t wait to see what you’re coming up with by the way. Sounds like an interesting mod!




Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 10-22-2013 01:15 PM           Profile Send private message  E-mail  Edit post Reply with quote


Yeah, it looks good.

Just a note about lowering the sensitivity when it's thrusting, why? If it's to make the plane turning slower when it moves forward, it is not necessary. In the game the plane always turns around itself with the same speed, what happens is that when it's moving forward it makes a circle because of the forward speed and when it's in free fall it just turns around itself (or making a little circle, because of the low speed). I wouldn't change the sensitivity, I would just limit the turning speed.




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 10-30-2013 01:55 AM           Profile Send private message  E-mail  Edit post Reply with quote


Thanks to both of you for replying !

UglyFoot wrote:
I wouldn't change the sensitivity, I would just limit the turning speed.


In baseQ3, there is no such thing as "turning speed", the mouse movements are directly converted in view angles, only multiplied by sensitivity and mouse acceleration factor. For the moment, dividing by 2 the mouse sensitivity will do the trick, since I really don't know how to implement a "max turning speed" system :)

Right now I'm still stuck with my player movement, I'm still studying the code, but it's more tough than it seems >< I think I've nailed down the logic, though :)



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 10-31-2013 09:23 AM           Profile Send private message  E-mail  Edit post Reply with quote


Ok, I said that to avoid that someone with a high sensitivity could be able to do turns of 180º in little time.

I'm not sure if it's possible to limit turning speed but I have a simple idea about how it could be done: Just measuring the time between two changes of viewangles and for each axis apply the formula (delta angle) / (delta time). If the result is greater than x then you limit it to x and you get the new angle like if turning speed were x.




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-04-2013 02:21 PM           Profile Send private message  E-mail  Edit post Reply with quote


Ok, I think I nailed down the player "physics" (well, acceleration and falling). I'm still struggling to add the rocket sound when the player is thrusting ! I understand how it works, it seems I have a sound that starts, but it doesn't play more than one frame or something like that. It's very strange :D

Here's how I'm doing it. In bg_pmove.c, I have a qboolean called "pm_thrusting".
Code:
      //if sound not looping, loop it
      if (pm_thrusting == qfalse) {
         PM_AddEvent( PM_ThrustStart() );
         pm_thrusting = qtrue;
         Com_Printf("ThrustSound Starting\n");
      }

/* other parts of code */

      //if sound is looping, stop it
      if (pm_thrusting == qtrue) {
         PM_AddEvent( PM_ThrustEnd() );
         pm_thrusting = qfalse;
         Com_Printf("ThrustSound Stopped\n");
      }


And here's what the console says when I play :
Image

You'll notice that the "thrustSound Starting" and "ThrustSound stopped" texts are appearing twice everytime ! How is that possible ? Is this phaenomenon the cause of my problem ?



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 11-05-2013 08:03 AM           Profile Send private message  E-mail  Edit post Reply with quote


The list of looping sounds is cleared at the start of every frame, take a look at CG_DrawActiveFrame.




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-05-2013 10:19 AM           Profile Send private message  E-mail  Edit post Reply with quote


Great ! Thanks a lot ! So you have to add "addLoopingSound" at everyframe to make it work ! Things are so much easier when you have somebody to explain them for you :D

Now I have the basic rocket sound playing when the player flies :D



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 25 Nov 2006
Posts: 101
PostPosted: 11-05-2013 11:58 AM           Profile Send private message  E-mail  Edit post Reply with quote


The game sounds like fun.
I see a very zen style of game.
Something like Flower http://en.m.wikipedia.org/wiki/Flower_(video_game) with a combat element in it...
Do you think there will be the abillity to build maps for this mod?
Or will it be some sort of infinite obstacle/surface-type generator?

Anyway it sounds really cool.



_________________
slugs and rockets


Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-05-2013 12:56 PM           Profile Send private message  E-mail  Edit post Reply with quote


Takkie wrote:
The game sounds like fun.
I see a very zen style of game.
Something like Flower http://en.m.wikipedia.org/wiki/Flower_(video_game) with a combat element in it...


I was thinking of a "basic" hardcore shooter with arcade and visceral sensations ... And even if I enjoy a lot Zen games (Proteus is very nice), I don't really know how I can connect the concept of "shooting things" to it ^^ That project is also an occasion for me to discover and learn how to make games with idTech 3, and boost up my coding skills.
Thanks for the Idea !

Takkie wrote:
Do you think there will be the abillity to build maps for this mod?
Or will it be some sort of infinite obstacle/surface-type generator?


At the moment, the map is a single square gaming zone with special triggers on each side that make it feel like it's infinite (look at my "looping square map" topic ;) ). I plan on making the enemies spawn randomly outside of a giver radius around the player. I haven't started working on the enemies for the moment, so the actual size of the map is temporary. The enemies would be planes and boats, like in Luftrauser, with different varieties, and maybe some sorts of oil platforms with multiple turrets ? I have a lot of images in my head, but at the moment, I don't even know if the base gameplay I'm planning can work in first person :D I have to work this out first :) (and it's very slow because I'm a noob).

Takkie wrote:
Anyway it sounds really cool.


Thanks !

So, now that I have some basic movement, I'll be adding the ocean brush / trigger, that damages the player if he touches, and at the same time makes it bounce proportionnally to the speed he was hitting it, like some sort of ricochet :)

The enemy planes should come right after !



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 11-06-2013 09:09 AM           Profile Send private message  E-mail  Edit post Reply with quote


D-Meat wrote:
I don't even know if the base gameplay I'm planning can work in first person :D I have to work this out first :)

If it becomes hard to see the other planes or boats you may use the middle mouse button to see what is behind, with a high fov and this you would see almost everything.




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-06-2013 01:24 PM           Profile Send private message  E-mail  Edit post Reply with quote


UglyFoot wrote:
D-Meat wrote:
I don't even know if the base gameplay I'm planning can work in first person :D I have to work this out first :)

If it becomes hard to see the other planes or boats you may use the middle mouse button to see what is behind, with a high fov and this you would see almost everything.


Thats a good idea ! in Descent / Forsaken, there was a "backmirror" camera on the top left of the screen that let you check what's going on behind :)



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-09-2013 01:59 AM           Profile Send private message  E-mail  Edit post Reply with quote


New Video !
https://www.youtube.com/watch?v=4nOp1JKbiSE

As you can see, there are some ammo boxes popping. This is bad. I have to modify my looping square map alorithm again :(

Sorry for the sound, I swear it works really well ingame ! I see what's going on : at each recorded frame by the demo, the sound starts. And when plaing the demo, that's what happens ! The normal rocket sound works fine though.

Next objectives : Make the player's bounding box into a cube, make the player model be a plane oriented in the exact angles of the camera. Repair the things I just talked about.

Next step : Adding enemy planes !

Maybe after that : adding a new "deformVertexes" keyword in order to deform the ocean nicely. DeforVertexes wave and Bulge aren't good enough for me ^^



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 11-09-2013 11:37 AM           Profile Send private message  E-mail  Edit post Reply with quote


Good, it's taking shape. If you get stuck with the popping items I suggest you to try my function, I think it's the simplest way to do it.




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44131
PostPosted: 11-10-2013 12:28 AM           Profile   Send private message  E-mail  Edit post Reply with quote


The throttle audio doesn't appear to loop properly. Is that a problem with the audio sample?




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-10-2013 09:04 AM           Profile Send private message  E-mail  Edit post Reply with quote


Dear UglyFoot,
I'm trying to fix definitively the "looping map" effect. Therefore, I'd like to try again to Duplicate my entities that need to be "looped".

Here's the code you've suggested in the "looping square map" topic :
UglyFoot wrote:
Code:
#define   SIDE_LEN 512

void CG_DuplicateEntity(centity_t *cent, void (* func)(centity_t*)) {
   int            i;
   vec3_t         initial_origin;
   vec3_t         trans_vecs[9];
   VectorSet(trans_vecs[0], 0, 0, 0);
   VectorSet(trans_vecs[1], SIDE_LEN, 0, 0);
   VectorSet(trans_vecs[2], SIDE_LEN, SIDE_LEN, 0);
   VectorSet(trans_vecs[3], 0, SIDE_LEN, 0);
   VectorSet(trans_vecs[4], -SIDE_LEN, SIDE_LEN, 0);
   VectorSet(trans_vecs[5], -SIDE_LEN, 0, 0);
   VectorSet(trans_vecs[6], -SIDE_LEN, -SIDE_LEN, 0);
   VectorSet(trans_vecs[7], 0, -SIDE_LEN, 0);
   VectorSet(trans_vecs[8], SIDE_LEN, -SIDE_LEN, 0);

   VectorCopy(cent->lerpOrigin, initial_origin);

   for(i=0; i<9; i++) {
      VectorAdd(cent->lerpOrigin, trans_vecs[i], cent->lerpOrigin);
      func(cent);
      VectorCopy(initial_origin, cent->lerpOrigin);
   }
}


Everything makes sense for me, except this :
Code:
func(cent);


This function is actually supposed to do the wanted "duplication" or adding an entity instance to the renderlist. Do you have any info (clues will do) on how to do that ?

Also, I'm not quite sure to understand what is going on here :
Code:
void CG_DuplicateEntity(centity_t *cent, void (* func)(centity_t*)) {

You add a void function as a parameter, but I don't see the point, I could declare it right before if I wanted, couldn't I ?

Thanks by advance !



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 11-10-2013 10:42 AM           Profile Send private message  E-mail  Edit post Reply with quote


The func function could be any of the functions used to add an entity to the renderlist. That's why it's passed as a parameter. For example it could be CG_Item, in CG_AddCEntity you have to replace
Code:
   case ET_ITEM:
      CG_Item( cent );
      break;

with
Code:
   case ET_ITEM:
      CG_DuplicateEntity (cent, CG_Item);
      break;




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-10-2013 10:55 AM           Profile Send private message  E-mail  Edit post Reply with quote


Aaaaah I get it :D
I'll try that, Thanks a lot !



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-11-2013 02:31 PM           Profile Send private message  E-mail  Edit post Reply with quote


BY FUCKING ODIN ! Man, UglyFoot,you're a genius. I'm sure it's actually John Carmack behind this nickname.

So, now I have a all situation working effect for my looping map effect. The only thing I'm worried about is the overfilling of the entity render list, actually limited to 1024. Well, I'll see when it crashes :D

Now, I'm moving on to the next step :)



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 11-11-2013 03:26 PM           Profile Send private message  E-mail  Edit post Reply with quote


Haha, I'm glad it worked :)




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-15-2013 02:23 AM           Profile Send private message  E-mail  Edit post Reply with quote


Hi there !

So, I've started working on the player model code, here's what I'm doing :

I've added a new fils : cg_PlanePlayers.c, and it will replace cg_players.c.

I also had the choice of either directly modifying cg_players.c or creating a md3 model of my plane that coud be compatible with the legs-torso-head system of quake 3.

I think I chose the simplest solution, and the one with which I'll learn the most things :D

I'm planning on modelling a simple test plane, with a normal map, and export it as md5 so I can test out the md5 support of ioQuake3.

The IQM format is also interresting, but it might be less supported than md5 ... Anybody here worked on that subject ?



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-25-2013 09:18 AM           Profile Send private message  E-mail  Edit post Reply with quote


Oh hi, here's some news !

Having a new system for the player model looks quite easy, I now have a good base on which I can add more features later.

But I'm having an ioQuake3 related problem :

I took this part as an opportunity to try out the IQM model format and some graphical features of ioquake3.

While I now can draw correctly an IQM model, I can't get the normal mapping to work on it. But it works well on md3 models !

Has anyone tried out that stuff before ?



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 11-25-2013 02:35 PM           Profile Send private message  E-mail  Edit post Reply with quote


No idea, It might help asking in the LEM forum.




Last edited by UglyFoot on 11-26-2013 10:35 AM, edited 1 time in total.

Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 11-26-2013 10:19 AM           Profile Send private message  E-mail  Edit post Reply with quote


Well, I solved the problem by switching to a more recent version of the new render engine of ioQuake3. Time to move on !



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 12-05-2013 08:07 AM           Profile Send private message  E-mail  Edit post Reply with quote


News !

I'm currently trying to add enemies in the game :) I'm starting with enemy planes.

What do the enemy planes do ?
-> they fly around, towards a player, shoot out a few bullets from time to time.
-> they can collide with players, causing damage.

Here's my plan :
I want my planes to be game entities managed by the server side.
I'm basing myself on the rockets code for the moment. The stuff is quite tough to go through, and I'm actually struggling to make a console command that shoots out a rocket from a given point - the way the "gentity_t *fire_rocket" function works is quite mysteriously, at the moment, no rocket appears when I use it in a cmd.

I have some tutorials that might help with some later things, like making the enemy plane follo the player, making it shoot plasma balls should be easy (I hope) ... But that first "setup" step is quite hard.

Second question, is it possible in quake 3 to use a mesh for collision for entities ?



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 12-05-2013 10:50 AM           Profile Send private message  E-mail  Edit post Reply with quote


Shooting a rocket with a command shouldn't be difficult, could you paste your code?

I think all collision detections are made with trap_Trace and trap_TraceCapsule so the answer could be no, but as a solution you could split the model in parts to make a trace for each part. trap_Trace does a box collision detection.




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 12-05-2013 11:26 AM           Profile Send private message  E-mail  Edit post Reply with quote


Sure :
Code:
void Cmd_SpawnEnemyPlane ( gentity_t *ent ) {
   gentity_t *plane;
   plane = fire_rocket ( ent, vec3_origin, axisDefault[0] );
   G_Printf("test\n");
}


I'm using fire_rocket for test purpose right now.

Thanks for the answer about collisions !



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 12-05-2013 12:22 PM           Profile Send private message  E-mail  Edit post Reply with quote


Update :
My thing seems to work, only the rocket model and sounds are not drawn ! I was testing in the new renderer of ioQuake 3 and the "3axis" default model doesn't appear here. I noticed when switching to the classic renderer. Strange, isn't it ?

Update #2 :
Everything actually works fine ! the rocket was not visible because the rocketl auncher was not in my test map. A "give all" later, everything went much better !

Hehe ...



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 22 Jul 2011
Posts: 139
PostPosted: 12-05-2013 02:36 PM           Profile Send private message  E-mail  Edit post Reply with quote


Oh, it was that. You could also register RL in ClearRegisteredItems (g_items.c), and PG as well.




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 12-11-2013 02:17 PM           Profile Send private message  E-mail  Edit post Reply with quote


Thanks for the tip :)

I've got some enemy airplanes flying towards the player right now !

I still want to add a couple of things before making a new video :
- The enemy planes have to be destroyable by the player. Could some one point me a tutorial about destroyable rockets or something like that ?
- The enemy planes shoot bullets / plasma balls from time to time. I think I can handle that :)



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Commander
Commander
Joined: 25 Nov 2006
Posts: 101
PostPosted: 12-11-2013 10:00 PM           Profile Send private message  E-mail  Edit post Reply with quote




_________________
slugs and rockets


Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 12-12-2013 12:17 AM           Profile Send private message  E-mail  Edit post Reply with quote


Great ! Thanks ! :D



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.