957 Commits
Author SHA1 Message Date
obligaron 51ab0106ab Sync monster spawn in multiplayer 2024-01-12 00:35:40 +01:00
obligaron 423150b457 Introduce SpawnMonster 2024-01-12 00:35:40 +01:00
obligaron b42b72221f Use PlayerAtPosition at more places 2023-12-05 20:40:30 +01:00
obligaron fae6b3d817 Change Player::getId() and MyPlayerId to uint8_t 2023-12-05 19:05:08 +01:00
obligaron 19b6e2bcc4 Fix debug spawning monsters 2023-12-03 11:12:27 +01:00
obligaron e7ba810af7 Update existing monsters after loading monster gfx 2023-12-02 00:50:45 +01:00
obligaron d4a70a2bc5 Fix MSVC warnings in monster.cpp/monsterdat.cpp 2023-11-28 22:18:51 +01:00
obligaron 42e1b82a91 Use GetDunSize in loops 2023-11-28 17:24:18 +01:00
obligaron 75f68e1b8f Introduce Player::occupyTile 2023-11-26 23:38:34 +01:00
obligaron 81d738e303 Introduce Monster::occupyTile 2023-11-26 17:39:50 +01:00
obligaron 79a43dc1de Introduce AddMissile overloads specific for player and monster 2023-11-26 13:36:28 +01:00
Gleb Mazovetskiy 99fea0d1c5 Migrate unique monsters to data files 2023-11-10 17:44:45 +00:00
Gleb Mazovetskiy 2eae121931 Migrate monstdat to a data file
We may want to migrate this to 1 file per monster but for now the
migration is as close to the hard-coded version as possible.

Sprites that are used by multiple monsters are only loaded from disk
once.
2023-11-10 06:01:40 +00:00
Gleb Mazovetskiy 0d19c1b773 Slightly optimize loading same-sprite monsters
For monsters with the same sprite, load the sprite from the file system only once.

Example:

```
VERBOSE: Loaded monster graphics: falspear\phall   452 KiB   x1
VERBOSE: Loaded monster graphics: skelbow\sklbw    618 KiB   x1
VERBOSE: Loaded monster graphics: skelsd\sklsr     610 KiB   x1
VERBOSE: Loaded monster graphics: goatbow\goatb    832 KiB   x1
VERBOSE: Loaded monster graphics: bat\bat          282 KiB   x2 <-- here we only load the sprite once
VERBOSE: Loaded monster graphics: rhino\rhino     1306 KiB   x1
VERBOSE: Loaded monster graphics: golem\golem      298 KiB   x1
VERBOSE:  Total monster graphics:                 4401 KiB 4684 KiB
```

Here, the bat sprite will be loaded from the MPQ only once.
For the second sprite, we simply clone the first sprite before applying TRNs.

This also reduces the size of `MonsterData` from 88 bytes to 80.

When we migrate monster data to a TSV, the sprite IDs can be generated automatically at load time.
2023-11-10 06:01:40 +00:00
Anders Jenbo bb2e189327 Convert _sfx_id in to class enum 2023-11-02 14:34:24 +01:00
Stephen C. Wills 7470862b14 Fix alignment on AiProc values (#6704) 2023-10-14 20:05:09 +02:00
Gleb Mazovetskiy 0f77cc3797 Force-inline methods to improve debug build perf
This has little or no effect on the optimized build
but significantly improves performance of the headless debug build

`timedemo_test` on my machine goes from 3s to 2s.
2023-09-10 02:14:01 +01:00
Gleb Mazovetskiy 62e9aa0448 MissilePosition: Use WorldTilePosition
Reduces struct size and makes the types of coordinates more obvious.
2023-08-29 20:00:54 +01:00
ephphatha da76e131e4 Add getter/setter for character levels to ensure _pNextExper stays synced 2023-08-24 05:46:44 +02:00
Gleb Mazovetskiy ba4def9382 Use utils/algorithm/container.hpp in more places 2023-08-19 19:57:11 +09:00
Gleb Mazovetskiy 8c1a847f41 Remove utils/stdcompat/string_view.hpp 2023-08-14 09:59:14 +01:00
Gleb Mazovetskiy e9b5ec77f9 Remove AppendStrView 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy c19bfe87fa Remove utils/stdcompat/algorithm.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 62d067b653 Remove utils/stdcompat/abs.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 74755c8be7 Remove utils/stdcompat/cstddef.hpp 2023-08-14 01:54:29 +01:00
Stephen C. Wills 94c7e7fc01 Add bounds check to MonsterIdle() to prevent var2 overflow (#6395) 2023-07-26 21:48:02 +02:00
Gleb Mazovetskiy d8cd147ac7 Re-encode CL2 on load
Original Blizzard encoder is slightly less optimal than our encoder.

While size in RAM in less of a concern for the non-`UNPACKED_MPQS`
build, smaller files are faster to render.

Savings for unpacked and minified MPQs:
* diabdat.mpq: 918,311 bytes.
* hellfire.mpq: 313,882 bytes.

Example player graphics (note that only a few are loaded at any given time for single player):
* diabdat/plrgfx/warrior/: 366,564 bytes.

Example monster graphics savings:

* diabdat/monsters/skelbow: 5,391 bytes.

Based on the implementation from https://github.com/diasurgical/devilutionx-graphics-tools/pull/6
2023-07-13 01:44:16 +01:00
Gleb Mazovetskiy de081b7080 Fix a few compilation warnings 2023-07-12 12:35:06 +01:00
Anders Jenbo 13e3217578 Only play the dialogs for the initating player (#6173)
* Only play the The Chamber of Bone lore for the reader

* Only play dialog for the player who is having the conversation

* Allow rock quest when skipping to level 5
2023-06-03 01:37:37 +02:00
staphen 217f6aee85 Don't turn monster towards player during hit recovery if monster is petrified 2023-05-30 00:51:32 +02:00
obligaron d46aa0e2bc Always check for uniqueType in TalktoMonster 2023-05-29 23:16:00 +02:00
obligaron aa354849ee Fix stone curse shows the wrong animation & infinite petrify 2023-05-28 11:19:42 +02:00
obligaron 31fe55a161 Prevent hellfire quests from disapearing from quest log 2023-05-28 01:51:56 +02:00
obligaron 1e8230b9b1 Move Gharbad talk logic (spawn item) to TalktoMonster 2023-05-24 00:57:12 +02:00
obligaron 3f195ae29b Use CMD_SPAWNITEM to spawn Ghardbards first item 2023-05-24 00:57:12 +02:00
obligaron deee72b0bc Move Zhar talk logic (spawn item) to TalktoMonster 2023-05-24 00:57:12 +02:00
obligaron e1082126a3 Use CMD_SPAWNITEM to spawn Zhars first book 2023-05-24 00:57:12 +02:00
staphen 874fa6b8d3 Fix monster light offset after walk animation ends 2023-05-13 05:11:25 +02:00
Gleb Mazovetskiy 4fa3732526 Add missing <cstdint> includes
Done with the following script:

```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
  v = File.read(path)
  next if !v.include?("uint32_t") || v.include?("cstdint")

  lines = v.lines
  line_num = if lines[2].start_with?(" *")
    lines.index { |l| l.start_with?(" */") } + 3
  else
    3
  end

  lines.insert(line_num, "#include <cstdint>\n")

  File.write(path, lines.join(""))
end
```

then fixed-up manually
2023-05-10 13:50:12 +01:00
Anders Jenbo b7424a0068 Clean up PmChangeLightOff() 2023-04-30 01:03:34 +02:00
staphen 45da8b2295 Remove unique monster's light when no corpse is left behind 2023-04-25 19:16:44 +02:00
Trihedraf 7baaa3c35e Fix monster health to +100 for NM and +200 for Hell instead of +1 and +3 (#5987) 2023-04-16 19:26:16 +02:00
Eric Robinson 81e3c7abaa Remove fixed bugfix comments, apply golem fix 2023-04-13 21:18:04 +02:00
Gleb Mazovetskiy 957bd03b98 Remove FMT_COMPILE in "cold" places
Removes most `FMT_COMPILE` calls.
`FMT_COMPILE` results in better performance but larger code size.

Removes `FMT_COMPILE` calls for places that are called infrequently,
i.e. not on every frame.

RG-99 binary size reduced by ~4 KiB.
2023-03-12 19:29:35 +01:00
obligaron 63b04045f2 MP: Send delta message for lachdanans death 2023-03-04 12:37:25 +01:00
obligaron 6a5210e14a Multiplayer: Enable Lachdanan Quest 2023-02-25 02:48:58 +01:00
obligaronandqndel 3a31539c7e Multiplayer: Enable Warlord of Blood Quest
Update Source/quests.h

Co-authored-by: qndel <[email protected]>
2023-02-20 21:30:50 +01:00
obligaron 76528246d7 Multiplayer: Enable Zhar the Mad Quest (#5823) 2023-02-19 22:06:08 +01:00
obligaron 31b0f2147a Multiplayer: Enable Gharbad the Week Quest 2023-02-19 14:13:06 +01:00
Gleb Mazovetskiy e67ea9b006 Make MissilesData const
Instead of temporarily modifying `MissileData` around certain calls,
pass the arguments from the outside.
2023-02-15 10:47:08 +00:00