Commit Graph
130 Commits
Author SHA1 Message Date
ac-stef b1b789eefc rename transformoldentities
now that old entities also get re-scaled, "transformoldentitytypes" is
more appropriate
2015-05-18 14:59:41 +02:00
ac-stef 03f974b2bc additional text attributes for mapmodels
This adds a means to store additional attributes for mapmodels, including
a caching mechanism, so the mapmodels don't have to be loaded to access
the information. The goal is, to provide fully automatic mapmodel menus
for map editing who also add information about downloaded mapmodels.

Model attributes are extracted everytime, when a model is loaded. At game
end, all available data is written to config/mapmodelattributes.cfg and
restored at next startup. On release, a file with all (but only) official
models should be included. Since autodownloaded models are usually "loaded"
after download, those are automatically added to the database. If someone
adds models manually to the directories (media pack, w/e), the command
"loadallmapmodels" can be used to try to find all available models. The
only way to delete something from the database, is to delete the file
config/mapmodelattributes.cfg when the game is closed.

The current list of attributes is:

keywords
  List of one or more menu topics to list the model under. Check
  config/menus_edit.cfg for available keywords. Unknown keywords will
  be listed separately.

desc
  Short name or description of the model. Will be used as menu entry.

usage
  Important information for how to use that specific model.

author
  Who created the mapmodel. If it's a derivative of another model, state
  the author of the mod (refer to the original author under "license", if
  you like). Always use the exact same spelling for the same author, to
  allow menus to automatically group models by author.

license
  Free-text attribute for license info or info about additional
  contributors (or original authors for derivated works).

distribution
  One of "official", "autodownload" or "manual". Other values default to
  "manual". This is used to determine, if a map contains only original
  media or media that can be download automatically.

version
  Single numerical value to separate older from newer versions. Defaults
  to zero. Higher numbers mean "newer". Maybe someone manages to implement
  a versioning system for custom media in the future...

New commands:

mdlattribute <attr> <value>
  To be used in model config files. Adds a value for a specified
  attribute to the model.

mapmodelregister <modelpath> <attr1> <attr2> ...
  Adds values for all attributes to a specific mapmodel. This is used to
  restore the cached values from config/mapmodelattributes.cfg during
  game start. Does not actually verify of load the model.

mapmodelattributes <modelpath> <attr>
  Returns the value of a specific attribute of a mapmodel. If modelpath
  is a number, it is interpreted as index for the list of models in the
  current map config. If no attribute name is specified, all attributes
  are printed to the console instead.

getmapmodelattributes <list of attribute names>
  Returns a table of all known mapmodels. Each model is listed with the
  modelpath and the values for the requested attributes. To be used
  instead of a fixed table in menu_edit.cfg. In addition to attribute
  names, the function also allows the keywords "explodekeywords" and
  "sortby:" as arguments. If "explodekeywords" is given, all mapmodels
  with more than one keyword are listed multiple times, once for each
  keyword. If an attribute name is preceeded by "sortby:" the list will
  be sorted by this table column. If "sortby:" is used several times,
  this first sort will have highest priority. The list is always sorted
  by path by default.

  example:
    getmapmodelattributes sortby: author sortby: desc explodekeywords

loadallmapmodels
  Tries to load mapmodels from /all/ paths below packages/models/mapmodels.
  Will throw a lot of error messages, because not all directories contain
  models to load. This command can be used to build or rebuild the
  complete list of all available mapmodels. It is only necessary, if models
  are added manually to the directories, since every mapmodel gets added
  to the list when it is loaded - which takes care of all automatically
  downloaded models.

DOCREF mdlattribute mapmodelregister mapmodelattributes
DOCREF getmapmodelattributes loadallmapmodels
2015-05-17 00:24:38 +02:00
ac-stef 85f7a22e64 flush logfile in case of crash 2015-03-25 02:56:49 +01:00
ac-stef e369f3e415 move backup() 2015-02-08 17:39:15 +01:00
ac-stef 348f640507 new tool functions 2015-02-08 17:39:15 +01:00
ac-stef b76413ddc2 clean up stopwatch code
* SDL_GetTicks() returns uint
* there's no need to make a fuss about "starting" and "stopping" the clock
* instead of stopping the clock, we can now just get the elapsed time
2015-02-08 17:39:15 +01:00
ac-stef 685dbb8326 store old state of random generator to restore after a seed()
The light calculation requires the random generator to be seeded with a
constant - otherwise repeated light recalculations would make the lights
change.

This patch allows the random generator to go back to the state before the
static seed().
2015-02-08 17:39:14 +01:00
ac-stef 05a41b1c0a add endian swap routines for 64-bit integer values 2015-02-08 17:39:14 +01:00
ac-stef 7e7834af2c wrapper functions for threading and semaphores
allow the standalone linux server to use posix libraries instead of SDL
(using SDL can be forced by defining AC_FORCE_SDL_THREADS)
2015-02-08 17:39:14 +01:00
ac-stef 71dc155d45 fix loopvjrev
apparently, no one used this macro since 2007
2015-02-08 17:39:14 +01:00
ac-stef 39cbee947d Merge branch 'master' into next 2015-02-08 16:17:04 +01:00
ac-stef 5338f7bf54 new tool functions 2014-11-15 17:36:04 +01:00
ac-stef 6ede08d011 keep the last five versions of saved.cfg and init.cfg
Renames the existing saved.cfg to saved-old-1.cfg (and an existing -1 to
-2, and so on) before the new saved.cfg is written.

This should help in cases where players mess up their config, because the
config is deleted with a five-game-starts delay.
2014-11-02 23:17:00 +01:00
ac-stef 3bbe1f9555 fix mandatory client logfile
The logfile can't be created before the commandline arguments are parsed,
because before that, the home directory is unknown. This patch logs
into a memory buffer which is then copied to the logfile as soon as
the logfile is created after processing the commandline arguments.

The memory buffer is created during the initialisation of global variables,
and destroyed after the logfile is created.
2014-10-06 12:43:32 +02:00
ac-stef d81c884cea removed now redundant code
and substituted "copy file and delete original" with "move file"
2014-05-19 18:48:54 +02:00
ac-stef b0649b5ea5 multiple map buffers for map editing: "xmaps"
An xmap holds everything related to map editing at a certain moment: it is
a map editing snapshot. It contains the name, the header, the geometry,
the entities, the extra headers, the undo/redo data and the cameraposition
from the moment, the snapshot was taken.

Xmaps are held in memory and, if persistentxmaps is set to "1", are saved
at game end and restored at game start.

xmap_list
  lists all xmaps currently in memory

xmap_store <nickname>
  create a snapshot and store it under the given nickname
  (nicknames have to qualify as valid filenames)

xmap_restore <nickname>
  restores the named snapshot. Also creates a backup snapshot of the
  current editing data.

xmap_restore
  restores the last automatic backup snapshot. Automatic snapshots are
  taken, a) before a snapshot is restored, b) before a new map is loaded
  (if there were unsaved edits on the map) and c) when the game ends (if
  there were unsaved edits).

xmap_delete <nickname>
  deletes the named snapshot.

Unsaved edits are flagged in the HUD with an "U" in the lower right
corner of the screen.

The files with the persistent xmaps are stored in mapediting/xmaps. After
they were restored at game start, the files are moved to
mapediting/xmaps/backups. Xmap files are cubescript files.
2014-05-15 17:34:25 +02:00
ac-stef d3bda71212 map file addons: embedded config file; persistent undo/redo data
This commit establishes an extensible way of storing additional data in
map file headers. Those header extras can be permanent, like the embedded
config file or be used only once after map load like the undo/redo data.

Additional extra data can be easily added and will not break backward
compatibility, so this map format should hold up for quite some time.

To make things easier for mappers, maps can now be saved without invoking
the various optimisations. That, in combination with the stored undo data,
means, that editing a map can be picked up at exactly the same state, as
the map was saved in.

Maps will automatically be written in the appropriate fashion, depending
on the situation:
 1) for sendmap: no optimisation, no undo data
 2) savemap during editing: no optimisation, with undo data
 3) savemap when not editing: optimised, no undo data
 4) savemapoptimised: optimised, no undo data
(For savemap to save different maps during editing, the variable
 preserveundosonsave has to be "1". It is "0" by default.)

All of the above map files can be played without problems - they only
differ in file size. (However, maps with undo data may be too big to send)

The new command "embedconfigfile" will load the config file, include it in
the map header and rename the original text file.

"extractconfigfile" will write an embedded config file to a separate file
and remove it from the map header.

Embedded config files take precedence over regular config files and
therefore make it harder for cheaters to play with modified config files.

further changes: cleaned up some debugging code; more ASSERTs
2014-05-15 16:07:52 +02:00
ac-stef 24c5fada62 new cleanup tool for hidden map attributes
"mapmrproper" tries to optimize hidden attributes of maps in a way, that
the map can be handled in bigger chunks by the renderer.

The mipmapping routine does not take into account, if certain textures
of a cube are visible at all, when it collects otherwise identical cubes
to be handled en-bloc. "mapmrproper" changes invisible textures in a way,
that the cubes are in fact identical - so, that the mipmapper is satisfied.

This optimization is a bit too huge for now, to be used by savemap by
default (instead of toptimize()) - even though mapmrproper is far superior
to toptimize(). Since mapmrproper potentially changes a lot of textures,
it may be too annoying during the creation of a map anyway. It is a tool
to optimize the map, as soon as the geometry (and texturing) is done.

The optimizer does not change any map properties that are visible in any
way. The optical effect of slightly changing lighting of the map is caused
by the (light-) recalc() function at the end of the optimization run.
Every run of recalc() seems to have that effect (check for yourself, by
typing /recalc several times).

Before any changes are made, mapmrproper creates a backup, which can be
restored by "undo" (press "U"). Enable mipstats (F6), to see, what has
been done.

The command "calcmipstats" just counts all the mips in the current map,
and prints their numbers as 1x1/2x2/4x4/8x8/16x16/32x32/64x64.

Keep in mind, that map geometry /and/ lighting affects the mipmapping.
(To get a better idea of this, try changing the "lighterror" parameter)
2014-05-15 13:48:30 +02:00
ac-stef 8a091430c7 filter reserved windows filenames
this patch prevents the use of map names like COM1 and PRN for all clients,
so that windows clients wouldn't hang because of the map name

Thx, Jpablon
2014-05-14 22:17:21 +02:00
ac-stef c3d4713904 clean up map header handling
Older versions of ac did not obey the map header field "headersize".
When a map was written, only the "version" field was updated, even if
the new written header had a different size. Thanks to bigger headers
in map versions 7 & 8 (and now smaller headers again in 9), the headersize
of basically all official maps is bogus. This fix makes sure, only proper
headersizes are written. It also makes the game tolerate different (bigger)
headers - and keeps their content untouched. Future map format extensions
can use this to add header information without breaking existing map parsers.

This patch establishes a new map format 10, which is identical to format 9,
with the exception that the headersize field is guaranteed to be correct.
Format 10 also allows any amount of additional header data.

This patch also cleans up the transformation routines for old map entities.
2014-01-27 23:01:23 +01:00
Lucas GAUTHERON 880b496718 dot ('.') should be allowed in map names
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7600 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-10-12 12:44:28 +00:00
Lucas GAUTHERON 71754e0cf1 allow maps with a sane name only
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7537 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-08-12 11:56:53 +00:00
Lucas GAUTHERON a7a1e46bcc merged branch
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7382 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-22 19:49:21 +00:00
sireus 4af75e15e0 no need for memmove here
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6868 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-08-25 10:05:09 +00:00
Lucas GAUTHERON bfda69a7f1 extending rev 6866 fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6867 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-08-25 07:08:59 +00:00
Lee Salzman 6c4b5b9a3a cheaper water animation
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6657 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-09-26 07:45:17 +00:00
aerkefiende 06f73f4627 Replaced Tabs with 4 spaces in every source file
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6561 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-07-31 15:44:57 +00:00
Lee Salzman 40498772a2 strcaps cleanup, init overreadval to 0
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6133 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-03-19 20:08:51 +00:00
Lee Salzman 32d96b2be4 fix weirdness in random numbers and ray creation
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6005 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-01-15 21:20:31 +00:00
Rafael Barreto 205280b5e8 reverting the *brilliant* fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5516 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-08-01 21:44:12 +00:00
Rafael Barreto df140bc2bb disable warning "conversion from 'size_t' to 'int', possible loss of data"
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5514 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-08-01 21:14:17 +00:00
flowtron 94dc526837 lots of whitespace
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5265 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-02 16:49:20 +00:00
Rafael Barreto 07c41b2b99 n o w i t w i l l b e d e t e c t e d :P
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5143 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-04 20:49:20 +00:00
Rafael Barreto 2e9c12bf65 findpattern tool and clean up
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5141 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-04 19:50:03 +00:00
Rafael Barreto 7208dbb44f hudextras, points, protocol, clean up and so on
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5090 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-05-28 19:46:02 +00:00
Lee Salzman 5d109a6d62 server does not use libintl
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5051 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-05-25 20:20:31 +00:00
Rafael Barreto e8c97abd51 Makke's suggestion: make the shotgun longer range
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4880 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-05-16 15:49:29 +00:00
Lee Salzman 13fc6b3391 fixed wizard to not need STL
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4830 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-05-10 22:37:36 +00:00
Lee Salzman 7d90c91175 WIP port of sauer master server
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4803 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-05-04 19:42:40 +00:00
Lee Salzman b216b412fd concatstring fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4795 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-03-21 20:22:53 +00:00
Lee Salzman 0a352e793b removing old vector typedefs
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4788 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-03-11 23:19:42 +00:00
Lee Salzman be94c703f2 setsize -> shrink
setsizenodelete -> setsize
deletecontentsa -> deletearrays
deletecontentsp -> deletecontents
vrealloc -> growbuf



git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4787 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-03-11 23:06:26 +00:00
driAn e232a3f3ac dynamic rendering of utf8 characters such as umlauts by using ttf (wip)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4769 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-01-14 22:19:27 +00:00
Lee Salzman c4227bca8e use growable packetbuf instead of ucharbuf
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4762 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-01-12 00:03:30 +00:00
Lee Salzman b28974415c VC warning fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4718 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-11-08 01:08:53 +00:00
Lee Salzman 9256ee374b support for loading from zip files
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4717 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-11-08 00:53:19 +00:00
Lee Salzman e725e5ed8c string function cleanups
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4714 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-11-07 22:44:32 +00:00
Lee Salzman 4fa39f1380 VC warning fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4688 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-11-07 06:18:35 +00:00
Lee Salzman 6a2e6b7fc2 i18n compile fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4630 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-08-12 21:07:46 +00:00
driAn 581ecdb9f6 translated main menu to german, omitting header info in gettext calls, libs, test gettext call in menuitem render
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4629 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-08-12 20:58:29 +00:00