Quake3World.com Forums
     Programming Discussion
        enabling the true type font for your mod


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: enabling the true type font for your mod

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-06-2013 06:30 AM           Profile Send private message  E-mail  Edit post Reply with quote


how can i add the truetype font to my mod?
the code's inside code / renderer / tr_font.c

the clue's:
00068 // Currently a define in the project turns on or off the FreeType code which is currently
00069 // defined out. To pre-render new fonts you need enable the define ( BUILD_FREETYPE ) and
00070 // uncheck the exclude from build check box in the FreeType2 area of the Renderer project.

but i haven't any idea about where i need to add and uncheck.
Any help will be appreciated in order to put the threewave font on my mod ui




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 384
PostPosted: 03-06-2013 08:54 AM           Profile Send private message  E-mail  Edit post Reply with quote


I've only seen standard Q3A monospaced font in Threewave...

Image

A MISSIONPACK build on the other hand allows you to use .dat file font maps if that's what you're looking for. It's the same thing as what Quake Live uses.

If you're using ioquake3 you could try putting this in your makefile near the top:
Code:
ifndef BUILD_FREETYPE
  BUILD_FREETYPE = 1
endif


And this at around line 930:
Code:
ifeq ($(BUILD_FREETYPE),1)
  BASE_CFLAGS += -DFREETYPE
endif




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-06-2013 06:18 PM           Profile Send private message  E-mail  Edit post Reply with quote


actually for some strange reason i can't compile ioquake and i'm still using the quake 3 source code. but i will try what you suggest! how's your mod muff?




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 384
PostPosted: 03-06-2013 10:04 PM           Profile Send private message  E-mail  Edit post Reply with quote


ioquake3 is damn easy to compile. Just install MinGW, run it, set the folder that the makefile is in and go make:
Code:
cd c:/ioquake3
make


The mod is coming along slowly but surely. My WIP:
- adding Q2 BSP (v. 38) support
- adding the last few missing Q2 map entities and more support for missions. func_door_secret is proving to be a pain in the ass!
- integrating weapon fx code from ST: Elite Force and missile hit effects from Wolf ET
- weapon recoil effects from Wolf ET
- map list functionality and extra map voting controls
- tweaking player physics and trying to get proper double jump movement like in QL

I just have a really strange bug that I can't seem to get rid of, otherwise it's all going smoothly.




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-07-2013 07:35 AM           Profile Send private message  E-mail  Edit post Reply with quote


I needed to restart my mod from zero.
I got ioquake3 and i was able to compile it x86 only.
I need to change all the source code and merge missinopack with baseq3 in order to turn on freetype fonts? ( i already added the strings you suggest me but nothing change using a normal baseq3 build (also because the last string was inside some kind of code for missionpack i suppose)


Wow your mod sounds ever more interesting. The v.38 support sounds good! also the fx and effects idea from ET sounds interesting!

double jump movement = the one at the top of the jumppad?

Also trying to play some defrag maps on QL i see a difference on strafe jump behaviour. :°( i think i will wait your mod :D




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 384
PostPosted: 03-09-2013 11:45 AM           Profile Send private message  E-mail  Edit post Reply with quote


Here's a thread I made a little while back that might help you out... viewtopic.php?f=16&t=47228 . But yes, merging everything together really makes the code so much easier to follow. For font you'll want to replace older functions like CG_DrawStringExt() with CG_Text_Paint(). CG_Text_Width() and CG_Text_Height() help with alignments etc.

------------

Yeah the biggest pain in the ass is going through all content and surface flag references and making them work for both sets which are very much different. But otherwise I've got most of the bsp lump functions sorted now so I'm a step in the right direction.

------------

Well they call it chain jumping in QL which is basically both double jumping and step jumping in one. Here's a good demonstration: http://www.youtube.com/watch?v=bGrv4kzFzqk




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-09-2013 06:38 PM           Profile Send private message  E-mail  Edit post Reply with quote


I already checked your makefile :D the most long work is to erase the various ifndef missionpack etc... and merge all the stuff from both "games". I'm doing it little by little, but i got the handicap that i don't have Team Arena CD.
----
you must post some movie about your work! i'm curious about that feature!
----
yes, basically it's a chain jumping!


Do you know where are coded the stuff about everykind of gamemode/gametype?
I'm trying to add Clan arena game but i'm working only in g_local and G_main. I need also to change team arena gameplay (usually in QL if you kill the quad damage carrier the powerup will be dropped...in q3a tdm doesn't happend.)




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 384
PostPosted: 03-10-2013 04:29 AM           Profile Send private message  E-mail  Edit post Reply with quote


A lot of the Team Arena assets are in Quake Live...

-----------

Yeah once I get that working I'll post something. Most of what I've done thus far has to do with game rules and other refiniements so not a lot to show with screenshots and videos.


Gametype code is all over the place. You'll want to start off with adding it to gametype_t after GT_TEAM but before GT_CTF so it's regarded as a team game but not capture-based, find where "Free For All" is listed and add that for the UI. Add something for it in the "gametype" entity key in g_spawn.c. UI_LoadArenas() has gametype keys for the arena files. Add roundlimit and roundtimelimit cvars, checking how it is done for fraglimit. That's the basic framework.

Cut off self-damage for CA in G_Damage after knockback is applied. G_Damage can also be used for checking damage delivered and adding a point per every 100 damage given. Then in g_active.c you should check how CheckTournament works - you can use something similar for the beginning of rounds. End of rounds can be triggered by using TeamCount()... player_die() might prove useful for that.

Anyway, that's a start. OpenArena has its own variation of CA. I think it's called Elimination. The source code could come in handy.




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-10-2013 10:23 AM           Profile Send private message  E-mail  Edit post Reply with quote


using CG_Text_Paint() it say that ITEM_TEXTSTYLE_SHADOWED need to be defined. o_O but it's already defined on cg_draw O_O let me recheck if i do something wrong in build.

mhmmm... maybe i need to add cg_newdraw.c in baseq3 build?
I already tried it but obviously a lot of stuff kills theyself




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-14-2013 12:28 PM           Profile Send private message  E-mail  Edit post Reply with quote


mhmmm i made a mess.
making the point: cg_text_paint is in draw.c under #ifdef MISSIONPACK. i tried to remove all the various #ifdef (ever watching to don't make a mess with multiple definitions etc...)
what i need to do in order to able the cg_text_paint function?
strangely if the build fail only if i erase the #ifdef about just one function bevore the //new hud stuff.. telling me about cgDC not defined etc... Where's the definition about cgDC stuff? O_o




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-16-2013 04:05 AM           Profile Send private message  E-mail  Edit post Reply with quote


ok i build with success with cg_text_paint function, i just forget to add in baseq3 compile the ui_shared...
Strangely enabling the cg_text_paint and removing the #stuff in c_draw, for example in drawcrosshairnames func, i will not get any kind of text like if there's no font or stuff to write on screen.
Do i need some kind of files somewhere?




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 384
PostPosted: 03-16-2013 08:34 AM           Profile Send private message  E-mail  Edit post Reply with quote


Replying to this and your PM in one go...

3xistence wrote:
hi muffin, just a question: how can i tell the game to use my font in cg_text_paint funct?
right about now it doesn't draw nothing. i Got a .ttf file (i also tried to put inside fonts directory the quakelive .dat and .png) O_o ?


Don't bother with ttf since you'll need to do a bunch of extra modifications to get that working. On the other hand it should work with the QL fonts. That's actually what I'm using right now in my mod (until I make it compatible with ttf that is)...

Image

You should add those dat and png files to the pk3 with your qvms in it and try again. I really can't remember having to do anything else after merging the missionpack build.




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-17-2013 05:26 AM           Profile Send private message  E-mail  Edit post Reply with quote


i will retry, but i haven't merged all the missionpack inside the baseq3. i'm slowly removing all the #ifdef MISSIONPACK #endif #else and trying to build everytime in order to check if baseq3 get build without errors. I can try, for second options, to add the baseq3 build files inside the missionpack and check if missionpacks builds fine.
mhmmm checking your image, you was able to correct the fov angles or you just changed the Z value for the weapon position?




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 384
PostPosted: 03-17-2013 10:46 AM           Profile Send private message  E-mail  Edit post Reply with quote


3xistence wrote:
you was able to correct the fov angles or you just changed the Z value for the weapon position?


Yeah it always irritated me how the fov messed up the view weapon so I made the offset milder and BAM... fixed...

cg_weapons.c: CG_AddViewWeapon():
Code:
   // drop gun lower at higher fov
   if ( cg_fov.integer > 90 ) {
      fovOffset = -0.2 * ( cg_fov.integer - 90 );
   } else {
      fovOffset = 0;
   }


Change that -0.2 to -0.1.




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-17-2013 11:44 AM           Profile Send private message  E-mail  Edit post Reply with quote


3xistence wrote:
Change that -0.2 to -0.1


already done it=D

i also noticed the name floating on Orb Bot,can it be?


I worked on the code all the day but still stucked with the truetype fonts stuff, using the missionpack build i can read everything correctly (but i don't have any menu etc...and i need to run maps from the console because i don't own the team arena expansion).

-_-




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 384
PostPosted: 03-18-2013 09:14 AM           Profile Send private message  E-mail  Edit post Reply with quote


3xistence wrote:
i also noticed the name floating on Orb Bot,can it be?


Nope, there's no name there.

3xistence wrote:
I worked on the code all the day but still stucked with the truetype fonts stuff, using the missionpack build i can read everything correctly (but i don't have any menu etc...and i need to run maps from the console because i don't own the team arena expansion).

-_-


Well then you've definitely done something wrong somewhere there. If you can't figure it out then you should stick with the missionpack build. Use QL's UI files for now until you either go back to the old Q3 UI or alter the UI how you want it.




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-18-2013 02:13 PM           Profile Send private message  E-mail  Edit post Reply with quote


probably i do. Do you merged missionpack on baseq3 and still using the baseq3 build? O__o watching your makefile i thinked you was using the missionpack build O__o




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-22-2013 08:14 AM           Profile Send private message  E-mail  Edit post Reply with quote


i find right now the problem, i still get error removing the #ifdef inside cg_draw.c about the loadhud stuff (the font's loaded inside the hud).




Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12498
PostPosted: 03-22-2013 08:48 AM           Profile Send private message  E-mail  Edit post Reply with quote


You shouldn't be merging the TA files with Q3A install. It's a whole lot easier (and less likely to cause problems) to just point GtkRadiant to your TA install under project settings.



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-22-2013 09:36 AM           Profile Send private message  E-mail  Edit post Reply with quote


in order to get the truetype fonts i need to use gtkradiant?? isn't it only for map makers?




Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12498
PostPosted: 03-22-2013 11:38 AM           Profile Send private message  E-mail  Edit post Reply with quote


I was talking just about the game assets, not if you are making a totally separate mod.



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 03-22-2013 06:52 PM           Profile Send private message  E-mail  Edit post Reply with quote


for now i merged all the code without problems, the big stuff is about the functions on cg_draw.c and cg_newdraw.c Probably my goal is embedded in the only #ifdef MISSIONPACK i wasn't able to remove (the one with cg_loadhud) sigh




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 06-17-2013 02:09 PM           Profile Send private message  E-mail  Edit post Reply with quote


btw for now i'm pretty satisfied. Muff, on your fist image...wtf map is it?




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 384
PostPosted: 06-18-2013 01:02 PM           Profile Send private message  E-mail  Edit post Reply with quote


q3wsx2 Silly Shootings




Top
                 

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 06-21-2013 01:04 PM           Profile Send private message  E-mail  Edit post Reply with quote


mhmm i miss that map, it's for q3a or it was for threewave?




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.