Forum

My Quake engine enhancements

Discuss Artificial Intelligence and Bot programming.

Moderator: InsideQC Admins

Postby revelator » Tue Jul 26, 2011 12:45 am

in that case sounds great :)
User avatar
revelator
 
Posts: 2527
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby frag.machine » Wed Jul 27, 2011 2:08 am

TheHyperborian wrote:
reckless wrote:np m8 :)

i dunno about if people would call it blasphemy but i reckon some would argue that it needs to keep compatibility with standard quake.

maintaining the above can really be a pain but in a way understandable
in case the developer in question drops the project before any compatible game data has even been made it would have been a waste.

tenebrae2 could have been a new quake like that but the project maintainer got hired by the company that made enemy territory
and dropped the project, so the only game you can play on the beta
version of the engine is an alpha of industry heh.

but i understand the feeling :) in the end its up to you what you want to do with it.




Well it will be able to play Quake, I am converting the QC files to Lua that come with Quake. My goal though isn't to play Quake but to use the engine as a platform for new mods, a platform to experiment with, an build that will make it easy for someone to quickly pick up and prototype a new game design. While it will play Quake, it might not play it exactly like the original. It isn't my goal, but anyone can freely borrow what they like from my build and use it however they want. The reason I am using Quake is because 1) It's open source 2) there are tons of tools available for it 3) I want to expand it and make it available for anyone to use to develop new games with it, especially for newbies, who might have done a little dark basic, they can jump write in. That is why Lua is a much better alternative to QuakeC for what I want to do, it will allow beginners to get into learning how to do game programming and develop their own games with it without having to touch the C code.


Even being a big fan of QuakeC, Lua support sounds more than reasonable - it's a logical evolutionary step, and thinking about a bit more, I'm quite surprised nobody didn't that before. I'll follow your work with great interest, please keep us updated in your progress. :)
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2066
Joined: Sat Nov 25, 2006 1:49 pm

Postby revelator » Wed Jul 27, 2011 2:52 am

heck if i could id probably yank in python as a replacement for QC but lua is easier so in that regard i totally agree :).
User avatar
revelator
 
Posts: 2527
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby TheHyperborian » Wed Jul 27, 2011 4:26 am

frag.machine wrote:
TheHyperborian wrote:
Even being a big fan of QuakeC, Lua support sounds more than reasonable - it's a logical evolutionary step, and thinking about a bit more, I'm quite surprised nobody didn't that before. I'll follow your work with great interest, please keep us updated in your progress. :)


Well syntactically, quakec and lua aren't very different. Whereas QuakeC is strongly type, Lua has no type. Whereas QuakeC uses field variables to store information in the entities, everything in Lua is a big table. Lua supports a limited OO programming model, and has a ton of built in libraries. The only thing is that vectors must be done as a userdata type, instead of being supported in the language like QuakeC does, but it's not really very hard to understand. So instead of doing something like this in quakeC

Code: Select all
local vector v1,v2;
v1 = v1 + v2;


in lua you'd do this
Code: Select all
v1 = vector.new(0,0,0)
v2 = vector.new(0,0,0)
result = vector.new(0,0,0)

vector.add(v1,v2,result)


But it is very easy to connect a Lua table to a C data structure, so basically you can script just about anything in the engine through Lua is you put in code to interface to it. And unlike QuakeC you don't have to declare variables beforehand to use them, you can access them in C by their name. So you don't have to compile the engine if you change the entvars_t structure and you don't have to change it at all in C.
TheHyperborian
 
Posts: 10
Joined: Sat Jul 23, 2011 12:35 am

Postby Spike » Wed Jul 27, 2011 4:43 am

qc was only really intended for fast event things, touch events, think timers, rather than complex loops or heavy logic - its all simple stuff with few loops.
it ought to be easy enough to convert id's qc source into lua, like I say, its all basic if/then logic. They're both a bit C-like.
Stuff like waypoints would probably be much simpler with lua, and ui stuff too I expect.

I think jogi had a go at some lua support a while ago, just clientside stuff. Not sure if he did anything with it.

Whatever lua's merits, the thought of stripping out QuakeC gives me the willies. If you're aiming for a 'this isn't quake anymore' engine, then obviously it doesn't matter, but if that's the case, I have to ask - why quake, and not quake3?
Spike
 
Posts: 2881
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby revelator » Wed Jul 27, 2011 2:17 pm

menu stuff also just have a look at world of warcraft :)

i really like the idea.
User avatar
revelator
 
Posts: 2527
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

sounds awesome

Postby hondobondo » Wed Jul 27, 2011 5:48 pm

though i do have one question: will mods have to be rewritten in lua or will the engine read standard progs.dat? not that i'm complaining. learning lua sounds like fun
hondobondo
 
Posts: 207
Joined: Tue Sep 26, 2006 2:48 am

Postby frag.machine » Thu Jul 28, 2011 3:30 am

@hondobondo: TBH I don't see the point of supporting both interpreters in the same engine. And from what I read about Lua, yes it looks quite fun to program.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2066
Joined: Sat Nov 25, 2006 1:49 pm

Previous

Return to Artificial Intelligence

Who is online

Users browsing this forum: No registered users and 1 guest