Page 1 of 2
[ioq3]"Air Rippers" development
Posted: Thu Oct 17, 2013 12:39 pm
by D-Meat
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 !
Re: [ioq3]"Air Rippers" development
Posted: Thu Oct 17, 2013 1:48 pm
by Eraser
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: Select all
// 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: Select all
// 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!
Re: [ioq3]"Air Rippers" development
Posted: Tue Oct 22, 2013 9:15 pm
by UglyFoot
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.
Re: [ioq3]"Air Rippers" development
Posted: Wed Oct 30, 2013 9:55 am
by D-Meat
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

Re: [ioq3]"Air Rippers" development
Posted: Thu Oct 31, 2013 5:23 pm
by UglyFoot
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.
Re: [ioq3]"Air Rippers" development
Posted: Mon Nov 04, 2013 10:21 pm
by D-Meat
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
Here's how I'm doing it. In bg_pmove.c, I have a qboolean called "pm_thrusting".
Code: Select all
//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 :
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 ?
Re: [ioq3]"Air Rippers" development
Posted: Tue Nov 05, 2013 4:03 pm
by UglyFoot
The list of looping sounds is cleared at the start of every frame, take a look at CG_DrawActiveFrame.
Re: [ioq3]"Air Rippers" development
Posted: Tue Nov 05, 2013 6:19 pm
by D-Meat
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
Now I have the basic rocket sound playing when the player flies

Re: [ioq3]"Air Rippers" development
Posted: Tue Nov 05, 2013 7:58 pm
by Takkie
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.
Re: [ioq3]"Air Rippers" development
Posted: Tue Nov 05, 2013 8:56 pm
by D-Meat
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

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 !
Re: [ioq3]"Air Rippers" development
Posted: Wed Nov 06, 2013 5:09 pm
by UglyFoot
D-Meat wrote:I don't even know if the base gameplay I'm planning can work in first person

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.
Re: [ioq3]"Air Rippers" development
Posted: Wed Nov 06, 2013 9:24 pm
by D-Meat
UglyFoot wrote:D-Meat wrote:I don't even know if the base gameplay I'm planning can work in first person

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

Re: [ioq3]"Air Rippers" development
Posted: Sat Nov 09, 2013 9:59 am
by D-Meat
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 ^^
Re: [ioq3]"Air Rippers" development
Posted: Sat Nov 09, 2013 7:37 pm
by UglyFoot
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.
Re: [ioq3]"Air Rippers" development
Posted: Sun Nov 10, 2013 8:28 am
by Eraser
The throttle audio doesn't appear to loop properly. Is that a problem with the audio sample?
Re: [ioq3]"Air Rippers" development
Posted: Sun Nov 10, 2013 5:04 pm
by D-Meat
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: Select all
#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 :
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: Select all
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 !
Re: [ioq3]"Air Rippers" development
Posted: Sun Nov 10, 2013 6:42 pm
by UglyFoot
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: Select all
case ET_ITEM:
CG_Item( cent );
break;
with
Code: Select all
case ET_ITEM:
CG_DuplicateEntity (cent, CG_Item);
break;
Re: [ioq3]"Air Rippers" development
Posted: Sun Nov 10, 2013 6:55 pm
by D-Meat
Aaaaah I get it

I'll try that, Thanks a lot !
Re: [ioq3]"Air Rippers" development
Posted: Mon Nov 11, 2013 10:31 pm
by D-Meat
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
Now, I'm moving on to the next step

Re: [ioq3]"Air Rippers" development
Posted: Mon Nov 11, 2013 11:26 pm
by UglyFoot
Haha, I'm glad it worked

Re: [ioq3]"Air Rippers" development
Posted: Fri Nov 15, 2013 10:23 am
by D-Meat
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
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 ?
Re: [ioq3]"Air Rippers" development
Posted: Mon Nov 25, 2013 5:18 pm
by D-Meat
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 ?
Re: [ioq3]"Air Rippers" development
Posted: Mon Nov 25, 2013 10:35 pm
by UglyFoot
No idea, It might help asking in the LEM forum.
Re: [ioq3]"Air Rippers" development
Posted: Tue Nov 26, 2013 6:19 pm
by D-Meat
Well, I solved the problem by switching to a more recent version of the new render engine of ioQuake3. Time to move on !
Re: [ioq3]"Air Rippers" development
Posted: Thu Dec 05, 2013 4:07 pm
by D-Meat
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 ?