Inside3D!
     

Base QuakeC - progs 2.0
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Chip



Joined: 21 Jan 2009
Posts: 314
Location: Romania

PostPosted: Wed Mar 03, 2010 7:58 pm    Post subject: Reply with quote

frag.machine wrote:
Something I adopted in my current mod is to split all missile attacks in a separated .qc file and then all the weapons are just bounded to the corresponding fireSomeStuff() function. It's far from ideal because the functions don't have a fixed signature yet, but that helps a lot to reuse code.


Yes! That's what I want! Modularity! New weapons added as plugins, not as editing the existing ones or adding more functions to the weapons.qc file.

Let the base source code untouched and add new qc files which in turn be referenced in a src file.

What about having a monster template? With behaviour, damage, speed, and so on. Want a new monster? Take the template and add your own variables.

The same for weapons, func_ stuff, etc.

Sorry for this, but I'm working on an old site and I need to make it modular and reuse LOTS of PHP code.
_________________
My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake
Back to top
View user's profile Send private message Visit poster's website
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Wed Mar 03, 2010 9:28 pm    Post subject: Reply with quote

Chip wrote:
What about having a monster template? With behaviour, damage, speed, and so on. Want a new monster? Take the template and add your own variables.

The same for weapons, func_ stuff, etc.


Smells like OO-QuakeC. Laughing
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
Junrall



Joined: 21 Sep 2009
Posts: 136
Location: North West Oregon, USA

PostPosted: Thu Mar 04, 2010 2:22 am    Post subject: Reply with quote

Chip wrote:
frag.machine wrote:
Something I adopted in my current mod is to split all missile attacks in a separated .qc file and then all the weapons are just bounded to the corresponding fireSomeStuff() function. It's far from ideal because the functions don't have a fixed signature yet, but that helps a lot to reuse code.


Yes! That's what I want! Modularity! New weapons added as plugins, not as editing the existing ones or adding more functions to the weapons.qc file.

Let the base source code untouched and add new qc files which in turn be referenced in a src file.

What about having a monster template? With behaviour, damage, speed, and so on. Want a new monster? Take the template and add your own variables.

The same for weapons, func_ stuff, etc.

Sorry for this, but I'm working on an old site and I need to make it modular and reuse LOTS of PHP code.


Laughing Yeah, I'm a big fan of modular stuff too... a weapons module would be nice... as well as a monster module.
Templates are great too, especially for a stripped down version of QC. A monster template would be very helpful... maybe four types of monster templates would be good: One flying, one swimming, one jumping, and one walking. And something similar for weapons.

So, how far down do you strip the QC code? Error, suggested down to the necessities... what would the necessities be?
_________________
Good God! You shot my leg off!
Back to top
View user's profile Send private message
Chip



Joined: 21 Jan 2009
Posts: 314
Location: Romania

PostPosted: Thu Mar 04, 2010 5:05 pm    Post subject: Templating system Reply with quote

Junrall wrote:
So, how far down do you strip the QC code? Error, suggested down to the necessities... what would the necessities be?


I'd say the bare necessities would be the core functions of the QC. Let's look at all the mods created for Quake. What has been modified? What hasn't been modified? What is the most modified feature?

We could start with the weapons and isolate all functions in a template. Then, the resulting QC file could be included somewhere. I'm thinking OO PHP here (as I'm a PHP programmer), but QC files are included in a .src file.

After the template has been stripped down (and rewritten while we're at it), it can be documented with functions, variables, constants. Also the dependencies would be written down and documented thoroughly.

It would be a helluva work, and all mods' source code should be browsed.

In an ideal world, we might end up with hundreds of ready-to-plug-in weapon templates (shotguns, RPGs, railguns, firethrowers, and so on).

Back to work now.
_________________
My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake
Back to top
View user's profile Send private message Visit poster's website
Junrall



Joined: 21 Sep 2009
Posts: 136
Location: North West Oregon, USA

PostPosted: Thu Mar 04, 2010 9:46 pm    Post subject: Reply with quote

I'm not familiar with OO or PHP... though, since I'm stuck at the airport for several hours I can do a quick search for OO and PHP to see where you are coming from. Wink
'sigh' I'm losing my co-worker pretty soon... which means I'll be traveling a crap load! Aaarg! this is going to take from my Quake time! LOL Laughing

So, if I'm reading you right... a person would just snatch up all of the functions involved with the weapon code, drop that into a working template qc file (I'm assuming to ease the process of stripping it down and to separate it from the main code), then strip the template down to something simplified... with basic/generic weapons.
I do like the idea of separating the weapons in to their own qc files... would make it easier to find stuff!

Ok, well... I got get back to work myself... well, sitting here for one thing!

Back again:
Chip wrote:
After the template has been stripped down (and rewritten while we're at it), it can be documented with functions, variables, constants. Also the dependencies would be written down and documented thoroughly.

It would be a helluva work, and all mods' source code should be browsed.

In an ideal world, we might end up with hundreds of ready-to-plug-in weapon templates (shotguns, RPGs, railguns, firethrowers, and so on).

Ok, desregard some of my floundering above... Rolling Eyes you pretty much summed it up.
I'm sooo tired...
_________________
Good God! You shot my leg off!
Back to top
View user's profile Send private message
gnounc



Joined: 06 Apr 2009
Posts: 120

PostPosted: Fri Mar 12, 2010 8:28 am    Post subject: Reply with quote

Decided to try my hand at cleaning up weapons.qc
I'm not sure how useful what I have so far is...
Just trying to reduce redundancy a bit

http://dl.dropbox.com/u/1776436/weapons%20rewrite.qc

lemme know whatcha think
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group