|
Posted by metlslime on 2007/08/08 04:57:56 |
This is a counterpart to the "Mapping Help" thread. If you need help with QuakeC coding, or questions about how to do some engine modification, this is the place for you! We've got a few coders here on the forum and hopefully someone knows the answer. |
|
|
#2336 posted by khreathor on 2017/06/21 20:46:25
Here you have add-on for blender that parses BSP. It's a python script, so very close to what you are looking for: https://github.com/andyp123/blender_io_mesh_bsp
I don't know about any other python BSP parser, but i bet there must be more of this... somewhere... :D
Quakespasm Source
#2337 posted by megaman on 2017/06/21 20:48:49
BSP Parsing Code
#2338 posted by Spike on 2017/06/21 20:51:47
https://github.com/ericwa/Quakespasm/blob/master/quakespasm/Quake/gl_model.c#L1969
if you just want a wireframe blob, walk through the faces lump, read the firstedge+numedges values and walk through the surfedges lump from that firstedge value for numedges entries. for each surfedge indicated, look up the edge entry that it indicates - if the surfedge is negative, negate it and use the second vertex from the indicated edge entry, otherwise use the first vertex from the edge.
that'll give you a loop of verticies, aka a triangle fan. get the actual vertex positions from the vertex loop.
textures come from surf->texinfo->texture. texture coords come from dotproduct(vertexcoord, surf->texinfo->vecs[S|T])-surf->texinfo->vecs[S|T][3];
lightmaps are overcomplicated. you'll need to calculate the texture coord extents, divide by 16 and round out to calculate the size of the per-surface lightmaps. then blend the up-to-four lightmaps per surface, atlas the result somehow according to the current lightstyle etc.
collision+pvs+ents+submodels are a different matter entirely, but they're half the fun.
Oh Awesome
#2339 posted by megaman on 2017/06/21 21:01:33
Thanks you two!
I was thinking about writing a map validation tool that unzips, reads bsp, checks if everything is there and parseable.
Quake Development CD 9/4/96
#2340 posted by madfox on 2017/06/25 18:18:46
I downloaded this file way back 2005. I had the impression it was able to recompile the quake.exe. By means of doing so I would be able to alter some of its components in the way I had the oppertunity to create my own "quake". The file is only 700kb large, has most of subdirectories full of *.c and *.h files.
Now I finally have it installed it looks as if I'm missing something. I knew I would get into trouble, reason I restrickted myself to qcc only.
Now I have a directory /quake/utils, tried the install.bat but get redrawn to D:QUAKE/UTILS/QCC>nmake /f "qcc.mak"CFG="qcc -WIN32 Release" The command or filename is incorrect.
Where should I start?
#2341 posted by madfox on 2017/06/25 18:21:39
I know there is a Install VC++ and MASM.
order, or use DJGPP to compile the dos version.
I'm downloading a file with 1Gb info , but I have no idea whee to begin.
@madfox
#2342 posted by Spike on 2017/06/25 18:54:43
nmake is microsoft's version of make. its kinda crap compared to gnu's [g]make. It comes bundled with msvc, I've no idea if there's any smaller bundles for it, but you'd need a c compiler anyway, so I wouldn't bother too much, just get msvc.
djgpp compiles for dos. if you're on a 64bit windows system then its almost useless (dosbox to the rescue?). Its available as a native dos compiler, or as a cross compiler from eg cygwin.
In this day and age, you should probably NOT start with the vanilla sourcecode. Its too limited and buggy. You would save yourself time by starting with eg quakespasm.
But yeah, I have to ask what you're actually trying to achieve? If its just making a quake mod then you don't need to bother with any of the above, just grab a base mod (like progs106.zip or some cleanqc thing like gnounc's) and then combine with a prebuilt qc compiler (like fteqccgui - the vanilla one is shite).
@spike
#2343 posted by madfox on 2017/06/25 19:39:40
Thanks for your reply!
First I'm on winxp32. I did some tinkering with qc and proqcc (now fteqccgui), and got a little familiar with it. That is.., spent weeks in urge to find a six lined string for the rat code from malice, before I found the malice qc and wondered what I missed. (I'm great!)
So in fact I'm more into trouble than I can get. What I tried to archive is searching in the AI Cafe, and sourceforge my curiosity is wakened about changing these *.c and *.h files.
As I look to the qc files there is nothing in it. While I do find them in this Quake developement CD.
So I know I am searching on the wrong place, but downloading the whole djggp file didn't get me any further.
What I try to do is get this cd working and see what's going on. Having V++ and MASM is a start, but I have no idea where I'm going.
Maybe the whisfull thinking of construckting a scuba gear, make reflecting water, or god knows.
A Request
It would be awesome to have a tool that can tell me the modelindex of an entity without having to compile and run the map.
Is it possible to determine this information before compilation? or is it so much work that it wouldn't be worthwhile?
#2345 posted by Baker on 2017/06/25 20:25:00
Look at the code here:
http://www.gamers.org/dEngine/quake/Qc/items.htm#item_health
And here ...
http://www.gamers.org/dEngine/quake/Qc/items.htm#item_artifact_super_damage
Do you see how the items even getting precached is dependent on what items are present in a map?
It even depends on spawnflags in some cases like health boxes. And it definitely depends on the actual order that of the entities in the map file.
So it can vary for skill level -- skill 1 vs. skill 2, etc.
Since modelindex is very hard to predict, you may ask yourself why are you using modelindex?
Which is the better question.
For sexy non-essential maphacks. I like the idea of pushing the engine / progs to its limits.
#2347 posted by Baker on 2017/06/26 02:07:02
The model name won't work?
Also are you sure you are using a model index? A brush model like "*5", that's not a model index -- that is the model name.
sorry you're correct, I mean edict number.
#2349 posted by Spike on 2017/06/26 02:28:32
model *5 will ALWAYS have modelindex 6, guaranteed. doesn't even need to be precached.
external models have pseudo-random indexes, but those inline models will always be assigned modelindexes by the engine and with reliable ordering etc.
edict numbers depend upon the max number of players. quite a few entities like walltorches will be handled with makestatic, and so will not increment edict numbers. Again it also depends upon spawnflags as to whether the entity will actually be spawned, etc.
By far the easiest way to get this sort of stuff to work is to include a custom progs.dat so that things don't have to be guessed at, but Baker won't like that either. :P
#2350 posted by Baker on 2017/06/26 03:28:21
The "model name" is "*5". The "*5" isn't a model index, the "*5" also isn't an edict number.
Those numbers are probably determined by the order that entities (func_wall, doors, etc.) are encountered as the bsp compiler compiles the .map.
So it is probably simply determined by order in the text file that is the .map, but I wouldn't 10000% swear by that, it is just a guess that is stands a pretty decent chance of being correct.
What are some good recommendations for a QuakeC compiler?
Fteqccgui.exe
#2352 posted by Qmaster on 2017/07/22 18:15:56
Progs.dat Helper??
#2353 posted by Qmaster on 2017/07/23 13:33:20
Does anyone know what progs.lno is?
Progs.dat Helper??
#2354 posted by Qmaster on 2017/07/23 13:33:24
Does anyone know what progs.lno is?
Line Number File
#2355 posted by Preach on 2017/07/23 13:53:45
You can ignore it for now, it isn't needed to run a mod.
(It is used for a specific engine when debugging your code, I believe that it allows the engine to return the line number that an error occurs on, aiding debugging. I've never made use of it though...)
Lno
#2356 posted by Spike on 2017/07/23 22:05:30
simply put, its a statementindex-to-linenumber lookup table.
dp uses it for just more readable error prints (no more meaningless numbers!).
fteqw uses it for step-by-step debugging, typically by hitting f5 inside fteqccgui and picking an fteqw build. you can then set breakpoints in the gui with f9 and single-step with f11. mouse-over variables to see their current values. wouldn't be possible without the info in those .lno files.
If they annoy you, you can compile with -O2 (or -Of, or even '#pragma optimise filenames'), fteqcc will then also stop generating these lno files (they arn't very useful when there's no way to tell which file they're lines of).
So yeah, they're situationally useful, but if an end user actually needs them then you already screwed up, such that there's not really much point distributing them (no harm in it, just pointless). You should otherwise just ignore them - they're totally useless on their own.
Great! Thanks!
#2357 posted by Qmaster on 2017/07/24 18:52:55
Is There A Q1 Engine With Good Netcode?
#2358 posted by anonymous user on 2017/07/28 02:58:10
I'm working on a mod and its mostly a multiplayer one. I've started with Quakespasm but it sucks for multiplayer. Is there a good Q1 engine with decent netcode and multiplayer capabilities? I'm looking for something that makes it easy for people to create servers and join with their friends.
I'm even considering switching to ioquake for that, even though i only know QuakeC. :(
#2359 posted by Baker on 2017/07/28 04:14:35
Practical options:
1) Use DarkPlaces as server and Spiked Quakespasm (QSS) as a client. Have a proper Quake client in Spiked Quakespasm, while having proper netcode (DPP7).
2) Use DarkPlaces. But doesn't have the correct classic Quake look.
3) Use FTE. Possibly your best option by far because FTE has nearly limitless capabilities and is very strong in multiplayer.
Practical answer:
You have a huge problem though ...
I'm looking for something that makes it easy for people to create servers
This ain't going to happen. Anyone who has a router (that's most people) --- are there dozens of brands of routers -- is going to have to manually configure their router to allow connections to their server.
That is going to prevent nearly every non-technical person from ever hosting a server.
Doesn't matter what game it is ioQuake or MineCraft or anything else --- the router configuration problem is simply going to prevent an average user from ever hosting a server.
#2358
#2360 posted by Spike on 2017/07/28 07:29:47
yes, imho.
FTE has single-socket servers, prediction, master servers, spectator mode, nack deltas, voip, ipv6, splitscreen, qw/nq cross-compat, etc. It even has a plugin that can usually invite/connect/call directly to xmpp friends. It also imho has the most versatile qcvm(including proper debugging) and better model formats than mdl(no more qme!) so its great for mods too.
ezQuake, DP, or QSS[not vanilla quakespasm] are your runner-ups. They all use a single-server-socket, so it should be possible to set up firewall rules without too many issues.
That xmpp thing would be awesome if getting everyone to set up xmpp accounts and enter passwords etc wasn't such a burden. What it does mean is that you shouldn't need to reconfigure any routers - just enable the plugin and invite/join your contacts.
This is roughly equivalent to using steams' contact list to start games, just with a 3rd-party/unlocked chat server.
Obviously this only applies to private games, and its not guaranteed but it should work with 90% of routers (google's stat from their voip-over-ice offerings).
If all else fails, there's nat-pmp/pcp or upnp-igdp protocols that can be used to reconfigure routers. You can set 'sv_port_natpmp 5351' in FTE for the former if you've some mac-friendly router, but I never properly tried to add support for the massively-overcomplicated-and-permanently-quirky upnp-igdp protocol despite it being more commonly supported. Note that programs like Skype constantly rewrite your router's firewall rules using this sort of thing.
So yeah, never say never.
@Baker, DPP7 doesn't provide anything useful to QSS that isn't also provided by the FTE+999 protocol that QSS supports. I added it because I'm a sucker for compat rather than any other consideration (the client side for either protocol isn't particularly hard anyway when you ignore csqc etc, I doubt you'd have issues adding it/them to markv to a similar level, except for the particles anyway).
|
|
You must be logged in to post in this thread.
|
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.
|
|