Commit Graph
3849 Commits
Author SHA1 Message Date
ac-stef 90a3e5bcbd Merge branch 'master' into next 2014-06-24 11:56:02 +02:00
ac-stef 556b1eb7f2 add map vantage points
The vantage point is supposed to be a distinctive view on a map - like the
angle from which the preview picture was taken.

This commit adds three commands: clearvantagepoint, setvantagepoint and
gotovantagepoint. None has any parameters, all are only allowed in edit
mode. A map can only have one vantage point.
2014-06-23 16:15:47 +02:00
aurhat 5a88f9c323 Fix bugs in spectator mode and removed unused FPCNs
First fix - now togglespect lets to return automatically to previously
spectated player, after spectating him, switching to "fly spectate" mode
and again to spectating players.
Second fix - now player doesn't land and stuck outside of new map,
when during spectating somebody map changed.
FCPNs are removed, because currently they aren't used.
2014-06-20 22:13:18 +02:00
aurhatandac-stef 07780a8f92 move the clock to the right side 2014-06-11 22:24:31 +02:00
ac-stef b3ee85fd6d fix failed assertion on making selections in editmode
last() may not be used on an empty vector

also, the FIXME was obsolete, since addselection() does call correctsel()
2014-06-07 00:30:50 +02:00
ac-stef 29dd50bde6 fix: keep path and uppercase in demo filenames
votes now distinguish between demo and map votecalls and filter the
filename appropriately

also: remove paths from map names cleanly
2014-05-25 00:35:22 +02:00
ac-stef b246e6e153 fix: don't play hard landing sounds on water transitions
fixes issue #57
2014-05-24 17:42:56 +02:00
ac-stef b29a6616e6 fix: don't apply water physics in edit mode
* no longer slows down the player under water
* no longer plays sounds for water transitions
* still plays underwater sound and shows underwater visual effects

fixes issue #56
2014-05-24 17:32:23 +02:00
ac-stef bca1e7a3cc play drop sound when exiting edit mode
...and the player "drops" back into the map
(fixes issue #55)
2014-05-24 16:47:07 +02:00
ac-stef a0286d2b3f replace textfilter functions with one-fits-all version
* replaces filtertext() with a version with a dozen of single filters
  that can be used in any combination
* defines classes of allowed characters for strings for various uses
  (see protocol.h line 153ff)
* now the allowed charset of, for example, player names is defined
  in one location only
* fixes issue #58
2014-05-24 12:59:19 +02:00
ac-stef e313a99beb fix buffer overflow for unknown mode numbers
to test, try /mode 1337 ; map ac_desert
2014-05-24 11:42:00 +02:00
aurhat b566c54664 Two fixes of wrong messages about change to active/spectate mode.
First fix causes, that when player1: plays non-team mode + already is in active mode + changes team to enemy, then will appear message: "you can't switch teams while being alive".
Current wrong message is: "you can't change to active mode".

Second fix disables redundant info: "$playername changed to active play", after change to enemy team in non-team modes, when he is already in active mode.
2014-05-22 20:58:46 +02:00
ac-stef 08faac728d fix: show intermission after demo playback
thx jamz :)
2014-05-21 22:50:19 +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 2768012579 fix: allow creating directories without homedir
With this fix, ac can also create directories relative to the working
directory. This fixes xmaps for users without homedir set.
2014-05-19 17:01:08 +02:00
ac-stef 493aefd34b fix: convert xmap path names for windows
* make sure, unsaved edits only count in editmode (otherwise "watercolour"
  in map configs would already be "edits")

* nicer filenames for backup-xmaps

* catch failed xmap file write access

* unsavededits is now flag (!= 0) and counter - to enable scripts to
  detect "new edits".

new commands:

xmap_delete_backup    deletes the backup xmap

xmap_keep_backup    moves the backup xmap to a regular named spot

xmap_rename    changes the nickname of an xmap
2014-05-19 12:31:26 +02:00
aurhatandac-stef b728a33bb3 Fix of wrong stats of pistol's ammo on HUD
...when player holds nade and akimbo disappears.
To test the bug: take akimbo, take grenade, press "g"  and wait for akimbo disappearing.
Then stats on HUD shows, that player has pistol with 0 ammo, instead of full magazine.
2014-05-17 23:41:38 +02:00
ac-stef d4b3526a19 fix clang warning 2014-05-17 14:56:43 +02:00
ac-stef 644d464cac fix: keep g++ attributes to g++ only
prevent wannabe compilers from parsing GNUC-only code
(clang++ apparently defines __GNUC__)
2014-05-17 14:27:43 +02:00
ac-stef 3b2b8c9250 fix makefile 2014-05-17 13:54:01 +02:00
aurhat 77f5b15ba9 Fix of doubled end of round, when spectator changes mode to active, short of the new round start.
This is fix of  https://github.com/assaultcube/AC/issues/18 . Patch restores structure changed in commit: https://github.com/assaultcube/AC/commit/5c117d .
There is added only "c.state.state==CS_SPECTATE" condition.
2014-05-17 12:00:54 +02:00
ac-stef f4af930865 cleaned up discrete player movement loop
some comments added
2014-05-16 18:56:17 +02:00
ac-stef 46ef8b58da fix sliding along corners
solves most stuck-conditions along corners
2014-05-16 18:56:17 +02:00
ac-stef 606af1ca9b fix issue #13 2014-05-16 18:56:17 +02:00
ac-stef 0cace56fc2 prevent nades from jumping out of water
when nades are thrown in shallow water with high enough speed, they
slow down while in the water - then, when they reach the surface again,
they jump out of the water

this patch takes 90% off of nade topspeed while leaving water
2014-05-16 18:56:17 +02:00
ac-stef e5a0ed37d5 fixed physics around corners
Until now, only the physics at corners between solids worked.
Corners between open space cubes (like sockets or platforms) did not work.
Basically, those corners were treated as square cubes. Higher mip corners
were worse, since they were treated as one square piece. To verify this,
raise an aligned 16x16 field on an empty map, then make an 8x8 corner.
Making the corner makes no difference for the physics...

This patch fixes all kinds of corners. It uses code from the renderer to
interpret the map geometry, so that the physics matches the visual.

All corner types now work also with higher mips (for example 4x4 corners).

Corner bounces are preferred in some cases, to prevent hitting hidden
geometry (for mappers who make larger corners from several small corners).
We lose some precision here, but it fixes the ancient drop bug.

I also cleaned up some unused bs.
2014-05-16 18:56:17 +02:00
ac-stef af92c3cf22 substitute ffs()
windows libraries seem to lack this nice function
2014-05-16 18:38:51 +02:00
Šarūnas Snapkauskasandac-stef 40f98595a8 server: fix blocking of non-existent primary guns
I think driAn meant to use OR, as using AND leads to FALSE.
2014-05-15 17:35:08 +02:00
aurhatandac-stef c0c68053e8 Fix of endless round in team arena mode
...when one team becomes empty, and in second team there are
more players than 1.

This is fix of https://github.com/assaultcube/AC/issues/24 .
2014-05-15 17:35:08 +02:00
aurhatandac-stef 56c8a2295b Fix lets to disable a roll of remote players.
This is fix of https://github.com/assaultcube/AC/issues/16 .
Btw sending permanently the rolls of remote players is waste of bandwidth and money of server owners, so this pointless feature should be ultimately removed.
But untill it won't, the fix should be implemented, in order to not annoy players spectated other players.
2014-05-15 17:35:08 +02:00
aurhatandac-stef 126c5325d5 Fix of non-working "Watch other demo" after watching demo with arena mode.
This is fix of https://github.com/assaultcube/AC/issues/19 bug.
Currently, when player spawns in arena mode, all menus disappear, in order to force him to play and not being idle.
That causes problem, that  "Play demo" menu disappears, when you watch demo with arena mode, and choose "Watch other demo".
It happens so, because after chosing "Watch other demo" player spawns on empty map, what causes vanishing of  "Play demo menu".
The commit causes, that menus are automatically closed exclusively then, when player is connected to server, because only then this feature is desired.
2014-05-15 17:35:08 +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 f4a4b843de engine tweak: quadrupling occlusion resolution without much computing effort
this patch gives the same occlusion resolution as NUMRAYS 2048, but still
maintains a table with only 512 entries
also, the 1536 additional rays start their search at the nearest already
found solid
2014-05-15 13:48:31 +02:00
ac-stef 5f484a45a5 engine tweak: fixing lighting postfilter
no longer directional IIR filtering, now it's (mostly) pure FIR
also, huge speedup (for example, ac_iceroad recalcs 80% faster)
2014-05-15 13:48:31 +02:00
ac-stef 9eceef38df engine tweak: cleaning up calclight 2014-05-15 13:48:31 +02:00
ac-stef 34b99ca713 engine tweak: static seed for random light calculation
repeated recalcs now produce the same lighting - also, every player
gets to see the same map
2014-05-15 13:48:31 +02:00
ac-stef b38fd1b57b engine tweak: speeding up blockcopy/blockpaste
used for dynlight, and that's realtime...
2014-05-15 13:48:31 +02:00
ac-stef 0dbaddd344 engine tweak: cleaned up worldrender 2014-05-15 13:48:31 +02:00
ac-stef 84da079bc0 engine tweak: double the speed of remip 2014-05-15 13:48:31 +02:00
ac-stef edc7f48f33 revert (hack style) fix to clean up invisible cubes
This fix is no longer needed, because the new corner handling in the
physics engine does no longer care about those cubes. Also, they can
now be cleaned up by mapmrproper.
2014-05-15 13:48:31 +02:00
ac-stef 832e46141b undo/redo with editmeta pressed also restores player position
also selects the affected area
(less useful in coopedit because always the own position is restored)

for testers: editmeta still defaults to LCTRL
2014-05-15 13:48:31 +02:00
ac-stef aaf01e8b2a redo for the editor
an undo for undos :)
2014-05-15 13:48:31 +02:00
ac-stef 859df26089 refactored load_world and save_world
* separated "loading the map" from "collecting map statistics"
* replaced the buggy toptimize with mapmrproper as default
  pre-save optimiser
* add timestamps to loadmap-stats
2014-05-15 13:48:30 +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 2a9d4a98c5 check texlists at map load
if by some freak accident the list gets corrupted, the textures are no
longer accessible from the map editor

this check makes sure, that nothing is missing
2014-05-15 13:48:30 +02:00
ac-stef 50b3f6867c show detailed data of the cube inside editing focus
* shows all geometry data of the cube in editing focus in the hud
* can be toggled by F8 in editmode
* shows cuby type, floor and ceiling heights, vdelta and all textures

(if mipstats *and* edit focus details are requested: show focus detail)
2014-05-15 13:48:30 +02:00
ac-stef a37d437a2f nicer mipstat display
* display mistats in the hud instead of having them flood the console
* added display of 8x8 mips, just to show that they are possible

press F6 in editmode to see the difference
2014-05-15 13:48:30 +02:00
ac-stef 2c2395d97a have the waterlevel variable reflect the actual value of the map 2014-05-15 11:43:37 +02:00
ac-stef ff8aea940d some edit fixes
* fixing edit paste
* fix power of 2 check for corner selection
* fix pasting multiple selections changed target selections
* fixing editdrag: plugging memory leak
* fixing editdrag: proper binding of keys
* fixing editdrag: allow deselecting (by selecting a second time)
* make a little more room for undos (RAM is cheap and maps are big)
* some cleanups
2014-05-15 11:42:54 +02:00