Author Topic: q2-dev  (Read 3125 times)

kren.Z

  • Guest
q2-dev
« on: June 08, 2008, 11:00:56 AM »
... just a taste of what's to come between tastyspleen and q2 (client/server/browser interfacing) while i gain a footing on more advanced  topics in 3D.

The Animation Engine is still a bit buggy ..workin' on that. I haven't added a preloader either, which shouldnt matter since this file is still pretty small ( > 100kb).


Controls:       
W - walk
SPACE - Jump
C - crouch

Click + Drag = rotate camera (careful though, I haven't added any boundaries)
Console displays parsed texture and md2 data from the C header.
                     
http://krenz.tastyspleen.net/q2-dev/main.html

I haven't been able to find a good reference to the .bsp file format, so If anyone knows any good tutorials on reverse engineering binaries, I'm all ears.

I'm new to quake 2 development so expect a lot of questions  :smiley_abau:

-krenZ
« Last Edit: January 28, 2014, 02:04:37 PM by krenZ »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]Jehar

  • Swanky Member
  • *****
  • Posts: 777
  • Gee Gee or Whatnot.
    • View Profile
    • Tastyspleen.tv
  • Rated:
Re: q2-dev
« Reply #1 on: June 08, 2008, 12:51:47 PM »
Kickass man, this is looking really promising. Where are you planning on taking this?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Tastyspleen ==Tastyspleen.tv==! All Quake, All the Time

kren.Z

  • Guest
Re: q2-dev
« Reply #2 on: June 08, 2008, 07:17:46 PM »
Where are you planning on taking this?

Well, the furthest it will go of course. Porting quake 2 to the browser would be the ultimate goal, but I think my primary focus now is using it as a tool to be more efficient in things like texture editing, demo/map viewing ...etc and eliminate the need for any stand-alone application. I have a lot of ideas about what i want to do, and the possibilities are endless between a browser/ (customized) server interface streaming real-time data. The native socket classes that I'm working with doesn't support UDP, so i'll have to find an alternative. The biggest difficulty i face as a new developer is understanding and parsing closed source binaries(external file formats) and client/server communication between unknown network protocols.


-krenZ

« Last Edit: January 28, 2014, 02:04:38 PM by krenZ »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline console

  • Brobdingnagian Member
  • ***
  • Posts: 4518
  • "Man, this is the way to travel," said my attorney
    • View Profile
    • tastyspleen.net
  • Rated:
Re: q2-dev
« Reply #3 on: June 08, 2008, 07:45:10 PM »
just a taste of what's to come between tastyspleen and q2 (client/server/browser interfacing) while i gain a footing on more advanced  topics in 3D.

Nice work. :thumbsup:


The biggest difficulty i face as a new developer is understanding and parsing closed source binaries(external file formats) and client/server communication between unknown network protocols.

q2 is open source.  Is there some particular file format or network protocol you are having trouble finding source code for?

Here's an old flipcode article on the q2 .bsp file format--this was written before q2 was open sourced:

http://www.flipcode.com/archives/Quake_2_BSP_File_Format.shtml

But nowadays we can also just look at the BSP file structures in qfiles.h, and the BSP map loading code in cmodel.c (CM_LoadMap, etc.)



Also - for what it's worth, a few years ago some folks ported Quake2 to java.  It would be possible to play in the browser.  (They may be using java web start so that it's not technically playing in the browser, but it could also be made into an applet--if you really wanted it inside the browser.)

http://www.bytonic.de/html/jake2.html


Regards,

:afro:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

kren.Z

  • Guest
Re: q2-dev
« Reply #4 on: June 09, 2008, 01:17:51 PM »
Thanks a lot quadz...I'm lookin' at the source now and all i can say is "wow". I'm unfamiliar with C, but hopefully it doesn't take to long to navigate through this bad boy. I think if i just understand some of the data structures I'll be alright. Anyways, your cmodel.c in /qcommon seems like the jackpot, exactly what i was looking for. A couple of quick questions if you don't mind,
I see a lot of

typedef struct
{
       //vars

} cnode_t;

or something similar. What kind of structure is this and what's its connection to cnode_t. All of the other code defined below it just seems like a bunch of functions. What's the purpose of header files in relation to .c files?


« Last Edit: January 28, 2014, 02:04:40 PM by krenZ »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline console

  • Brobdingnagian Member
  • ***
  • Posts: 4518
  • "Man, this is the way to travel," said my attorney
    • View Profile
    • tastyspleen.net
  • Rated:
Re: q2-dev
« Reply #5 on: June 09, 2008, 01:46:47 PM »
I see a lot of

typedef struct
{
       //vars

} cnode_t;

or something similar. What kind of structure is this and what's its connection to cnode_t.

typedef struct
{
    cplane_t    *plane;
    int         children[2];        // negative numbers are leafs
} cnode_t;

This is defining a structure with the typename cnode_t.  (I won't get into details about 'typedef' at this point...)

So, cnode_t is a structure which contains a pointer to a plane, and an array of two integers referring to the left/right child nodes of this node.


What's the purpose of header files in relation to .c files?

Header files exist because the C compiler is not very smart.  The compiler only compiles one execution unit (.c file) at a time, and it doesn't, at that time, have any knowledge of the contents of other .c files in the project.

So if you have a structure or function that you want to be shared among multiple .c files, information about that structure or function must be in a header file, which may be included by multiple .c files.

Thus, header files are for sharing type definitions and function declarations between multiple .c files.


Regards,

quadz

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

 

El Box de Shoutamente

Last 10 Shouts:

Costigan_Q2

November 11, 2024, 06:41:06 AM
"Stay cozy folks.

Everything is gonna be fine."

There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.

Show 50 latest
Welcome, Guest. Please login or register.
November 22, 2024, 02:46:02 PM

Login with username, password and session length