Forum

Quake C vs Blenders Game Engine's Python

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Quake C vs Blenders Game Engine's Python

Postby daemonicky » Tue May 24, 2011 7:27 pm

How these two compare? What is Your experience with Blender Game Engine? Was it fast enough? Is community good? What is the game flow of BGE? How do I make quake-like entities? Are there any recommendations how to work with it?

Quake lacks some functionality I need, and adding ti myself would take too much work and possibly be broken (clothes, water). I looked at blender and it seems it has something like "touch" by sensors->collision and I maybe even "think" sensors->delay (but I have no clue how to set it :-D)

Python is nice language. BGE API is not that nice as Quake C's, but I have not programmed anything in it yet.

Thanks. :)
User avatar
daemonicky
 
Posts: 185
Joined: Wed Apr 13, 2011 1:34 pm

Re: Quake C vs Blenders Game Engine's Python

Postby goldenboy » Tue May 24, 2011 11:31 pm

daemonicky wrote:How these two compare? What is Your experience with Blender Game Engine? Was it fast enough? Is community good? What is the game flow of BGE? How do I make quake-like entities? Are there any recommendations how to work with it?

Quake lacks some functionality I need, and adding ti myself would take too much work and possibly be broken (clothes, water). I looked at blender and it seems it has something like "touch" by sensors->collision and I maybe even "think" sensors->delay (but I have no clue how to set it :-D)

Python is nice language. BGE API is not that nice as Quake C's, but I have not programmed anything in it yet.

Thanks. :)


I think very few people here make games in BGE - this is mainly a Quake 1 / 2/ 3 and derivatives forum.

As I said elsewhere, a Blender game will be hardware hungry and laggy if you use too many polies, too fancy lighting and too many gizmos.

The Blender community is very knowlegeable and a few people make games in BGE. I think it will be more viable in the future, with better hardware.

Can't say much on Blender Python vs. QC. Ask at Blender forums!

Huge advantage with Blender is you have everything in one place - no stone-age tools and formats as in Quake. But some modern games are also good basis for modding (Crysis, Unreal, maybe Source, I don't know).
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Postby daemonicky » Thu May 26, 2011 12:16 pm

I just looked at some code for BGE. It is not so event driven like Quake C, I mean they have envents but You have to call functions to fill your data structures with data they need (it is hierarchical http://en.wikipedia.org/wiki/Hierarchical_model or network database http://en.wikipedia.org/wiki/Network_model ), like :

[color=green]Register[/color](draw,event,bevent) # there he registers event handlers

def draw():
global g, cam
....
#Draw grid
for I in range( Blender.Get("staframe"), Blender.Get("endframe"),100/g["zoom"]): #for vertical line
x = (Blender.Get("curframe")*g["zoom"])

....
dict = Blender.Registry.GetKey("cam_seq")
if dict:
cam = dict[Blender.Scene.GetCurrent().name]
for c in cam:
for n in c["node"]:
###getnextnode()
busted = Blender.Get("endframe")
for cc in cam:
for nn in cc["node"]:



Considering the amount of data you can acces and that this is not simplistic and one case (game, and first person one) oriented but I guess it is more general (you can make simulations of arbitrary stuff in BGE, not just games, pretty much anything ... like solar system ...). I will see how much I am going to miss Quake C's settin of state (movetype, model) and few event handlers (think, touch).
Plus "only" places it is connected to Quake are these
void main();
void StartFrame();
void PlayerPreThink();
void PlayerPostThink();
void ClientKill();
void ClientConnect();
void PutClientInServer();
void ClientDisconnect();
void SetNewParms();
void SetChangeParms();

... and there are some broadcast messages ...
User avatar
daemonicky
 
Posts: 185
Joined: Wed Apr 13, 2011 1:34 pm

Postby mh » Thu May 26, 2011 12:32 pm

Don't forget these:
Code: Select all
builtin_t pr_builtin[] =
{
   PF_Fixme,
   PF_makevectors,   // void(entity e)   makevectors       = #1;
   PF_setorigin,   // void(entity e, vector o) setorigin   = #2;
   PF_setmodel,   // void(entity e, string m) setmodel   = #3;
   PF_setsize,   // void(entity e, vector min, vector max) setsize = #4;
   PF_Fixme,   // void(entity e, vector min, vector max) setabssize = #5;
   PF_break,   // void() break                  = #6;
   PF_random,   // float() random                  = #7;
   PF_sound,   // void(entity e, float chan, string samp) sound = #8;
   PF_normalize,   // vector(vector v) normalize         = #9;
   PF_error,   // void(string e) error            = #10;
   PF_objerror,   // void(string e) objerror            = #11;
   PF_vlen,   // float(vector v) vlen            = #12;
   PF_vectoyaw,   // float(vector v) vectoyaw      = #13;
   PF_Spawn,   // entity() spawn                  = #14;
   PF_Remove,   // void(entity e) remove            = #15;
   PF_traceline,   // float(vector v1, vector v2, float tryents) traceline = #16;
   PF_checkclient,   // entity() clientlist               = #17;
   PF_Find,   // entity(entity start, .string fld, string match) find = #18;
   PF_precache_sound,   // void(string s) precache_sound      = #19;
   PF_precache_model,   // void(string s) precache_model      = #20;
   PF_stuffcmd,   // void(entity client, string s)stuffcmd = #21;
   PF_findradius,   // entity(vector org, float rad) findradius = #22;
   PF_bprint,   // void(string s) bprint            = #23;
   PF_sprint,   // void(entity client, string s) sprint = #24;
   PF_dprint,   // void(string s) dprint            = #25;
   PF_ftos,   // void(string s) ftos            = #26;
   PF_vtos,   // void(string s) vtos            = #27;
   PF_coredump,
   PF_traceon,
   PF_traceoff,
   PF_eprint,   // void(entity e) debug print an entire entity
   PF_walkmove, // float(float yaw, float dist) walkmove
   PF_Fixme, // float(float yaw, float dist) walkmove
   PF_droptofloor,
   PF_lightstyle,
   PF_rint,
   PF_floor,
   PF_ceil,
   PF_Fixme,
   PF_checkbottom,
   PF_pointcontents,
   PF_Fixme,
   PF_fabs,
   PF_aim,
   PF_cvar,
   PF_localcmd,
   PF_nextent,
   PF_particle,
   PF_changeyaw,
   PF_Fixme,
   PF_vectoangles,

   PF_WriteByte,
   PF_WriteChar,
   PF_WriteShort,
   PF_WriteLong,
   PF_WriteCoord,
   PF_WriteAngle,
   PF_WriteString,
   PF_WriteEntity,

#ifdef QUAKE2
   PF_sin,
   PF_cos,
   PF_sqrt,
   PF_changepitch,
   PF_TraceToss,
   PF_etos,
   PF_WaterMove,
#else
   PF_Fixme,
   PF_Fixme,
   PF_Fixme,
   PF_Fixme,
   PF_Fixme,
   PF_Fixme,
   PF_Fixme,
#endif

   SV_MoveToGoal,
   PF_precache_file,
   PF_makestatic,

   PF_changelevel,
   PF_Fixme,

   PF_cvar_set,
   PF_centerprint,

   PF_ambientsound,

   PF_precache_model,
   PF_precache_sound,      // precache_sound2 is different only for qcc
   PF_precache_file,

   PF_setspawnparms
};


And these:
Code: Select all
typedef struct
{
   int   pad[28];
   int   self;
   int   other;
   int   world;
   float   time;
   float   frametime;
   float   force_retouch;
   string_t   mapname;
   float   deathmatch;
   float   coop;
   float   teamplay;
   float   serverflags;
   float   total_secrets;
   float   total_monsters;
   float   found_secrets;
   float   killed_monsters;
   float   parm1;
   float   parm2;
   float   parm3;
   float   parm4;
   float   parm5;
   float   parm6;
   float   parm7;
   float   parm8;
   float   parm9;
   float   parm10;
   float   parm11;
   float   parm12;
   float   parm13;
   float   parm14;
   float   parm15;
   float   parm16;
   vec3_t   v_forward;
   vec3_t   v_up;
   vec3_t   v_right;
   float   trace_allsolid;
   float   trace_startsolid;
   float   trace_fraction;
   vec3_t   trace_endpos;
   vec3_t   trace_plane_normal;
   float   trace_plane_dist;
   int   trace_ent;
   float   trace_inopen;
   float   trace_inwater;
   int   msg_entity;
   func_t   main;
   func_t   StartFrame;
   func_t   PlayerPreThink;
   func_t   PlayerPostThink;
   func_t   ClientKill;
   func_t   ClientConnect;
   func_t   PutClientInServer;
   func_t   ClientDisconnect;
   func_t   SetNewParms;
   func_t   SetChangeParms;
} globalvars_t;


And these:
Code: Select all
typedef struct
{
   float   modelindex;
   vec3_t   absmin;
   vec3_t   absmax;
   float   ltime;
   float   movetype;
   float   solid;
   vec3_t   origin;
   vec3_t   oldorigin;
   vec3_t   velocity;
   vec3_t   angles;
   vec3_t   avelocity;
   vec3_t   punchangle;
   string_t   classname;
   string_t   model;
   float   frame;
   float   skin;
   float   effects;
   vec3_t   mins;
   vec3_t   maxs;
   vec3_t   size;
   func_t   touch;
   func_t   use;
   func_t   think;
   func_t   blocked;
   float   nextthink;
   int   groundentity;
   float   health;
   float   frags;
   float   weapon;
   string_t   weaponmodel;
   float   weaponframe;
   float   currentammo;
   float   ammo_shells;
   float   ammo_nails;
   float   ammo_rockets;
   float   ammo_cells;
   float   items;
   float   takedamage;
   int   chain;
   float   deadflag;
   vec3_t   view_ofs;
   float   button0;
   float   button1;
   float   button2;
   float   impulse;
   float   fixangle;
   vec3_t   v_angle;
   float   idealpitch;
   string_t   netname;
   int   enemy;
   float   flags;
   float   colormap;
   float   team;
   float   max_health;
   float   teleport_time;
   float   armortype;
   float   armorvalue;
   float   waterlevel;
   float   watertype;
   float   ideal_yaw;
   float   yaw_speed;
   int   aiment;
   int   goalentity;
   float   spawnflags;
   string_t   target;
   string_t   targetname;
   float   dmg_take;
   float   dmg_save;
   int   dmg_inflictor;
   int   owner;
   vec3_t   movedir;
   string_t   message;
   float   sounds;
   string_t   noise;
   string_t   noise1;
   string_t   noise2;
   string_t   noise3;
} entvars_t;
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby daemonicky » Thu May 26, 2011 2:53 pm

Nooooo, I am screwed :-D
User avatar
daemonicky
 
Posts: 185
Joined: Wed Apr 13, 2011 1:34 pm

Postby goldenboy » Thu May 26, 2011 8:34 pm

It's true, with Blender you can make a simulation of the solar system just as well as a simulation of a sci-fi Mars base with guns and aliens in it.

How similar are they? It depends how high-level your thinking is.

Experiment with a few game dev platforms and see what works for you. I still think that Quake can't do the kinds of things you want :)

Try Cryengine, it uses Lua for gamecode scripting. I found it pretty adequate last time I tried to mod it.
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Postby daemonicky » Tue Jun 07, 2011 3:17 pm

BGE uses Python to handle scripting. I like Python but I don't like the syntax of how to call BGE from Python yet. I liked how Quake C was simple to use. So my question is this, does anyone know about some wrapper which will make BGE appear similar to Quake C? I mean how to make BGE like Quake C? To have similar interface to simple spawn(), touch, movetype, think ...
Think, touch, movetype, solid, traceline ...
User avatar
daemonicky
 
Posts: 185
Joined: Wed Apr 13, 2011 1:34 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest