Skip to content

Instantly share code, notes, and snippets.

View jackpoz's full-sized avatar

Giacomo Pozzoni jackpoz

  • Stena Group IT
  • Gothenburg
View GitHub Profile
@jackpoz
jackpoz / gist:7632461
Last active March 22, 2024 13:51
WoW bot AI research
AI:
- genetic algorithm
- Microbial GA http://www.codeproject.com/Articles/16286/AI-Simple-Genetic-Algorithm-GA-to-solve-a-card-pro
- Immune A http://www.codeproject.com/Articles/27551/Artificial-Immune-Algorithm-in-C
- Roaches https://msdn.microsoft.com/en-us/magazine/mt632275?f=255&MSPPError=-2147217396
- neural network
- http://www.codeproject.com/Articles/16419/AI-Neural-Network-for-beginners-Part-1-of-3
- http://natureofcode.com/book/chapter-10-neural-networks/
- Markov decision process to change from 1 state to another (Q-learning/reinforcement learning). Neural Network could be just for the combat part.
- state machine (if/else)
@jackpoz
jackpoz / gist:6ad33fccfb2a799d0d83
Last active July 24, 2022 22:29
mmaps dynamic obstacles
https://github.com/memononen/recastnavigation/blob/master/Recast/Source/RecastArea.cpp#L538
https://groups.google.com/forum/m/#!topic/recastnavigation/OqJRHFoiVX8
http://digestingduck.blogspot.com/2012/05/detour-crowd-path-replanning.html
<jackpoz> current main mmaps issue is the time it takes to generate a tile, that's why 1) we do as much as we can work in mmaps_generator and 2) we dont' support dynamic gameobjects
<Rat_> this is https :D
<jackpoz> what if we add a threadpool (pseudo-technical term) where we can queue tile generations at runtime that will be set to the correct place when they are ready to be used ?
<jackpoz> let's say I spawn a gameobject, it queues a tile regeneration, for the next 5 seconds the gameobject has no mmap support, after that the tile is ready and the gameobject has mmap support
@jackpoz
jackpoz / gist:7c4ad34bbad619596c17
Last active December 29, 2018 21:45
valgrind/helgrind/ASan
cmake valgrind:
cmake .. -DCMAKE_INSTALL_PREFIX=/home/jackpoz/trinity -DWITH_COREDEBUG=FALSE -DWITH_WARNINGS=TRUE -DCMAKE_BUILD_TYPE=Debug -DNOJEM=TRUE -DSCRIPTS=static -DTOOLS=FALSE -DVALGRIND_INCLUDE_DIR=/home/jackpoz/valgrind/include
cmake valgrind jemalloc:
cmake .. -DCMAKE_INSTALL_PREFIX=/home/jackpoz/trinity -DWITH_COREDEBUG=FALSE -DWITH_WARNINGS=TRUE -DCMAKE_BUILD_TYPE=Debug -DNOJEM=FALSE -DSCRIPTS=static -DTOOLS=FALSE -DVALGRIND_INCLUDE_DIR=/home/jackpoz/valgrind/include
cmake helgrind:
cmake .. -DCMAKE_INSTALL_PREFIX=/home/jackpoz/trinity -DWITH_COREDEBUG=FALSE -DWITH_WARNINGS=TRUE -DCMAKE_BUILD_TYPE=Debug -DNOJEM=TRUE -DSCRIPTS=static -DTOOLS=FALSE -DVALGRIND_INCLUDE_DIR=/home/jackpoz/valgrind/include -DHELGRIND=TRUE
cmake helgrind jemalloc:
@jackpoz
jackpoz / windows update.reg
Created February 13, 2018 20:32
windows update.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat]
"cadca5fe-87d3-4b96-b7fb-a231484277cc"=dword:00000000
16,196 (128 direct, 16,068 indirect) bytes in 4 blocks are definitely lost in loss record 67 of 71
at 0x4C302BA: operator new(unsigned long) (vg_replace_malloc.c:334)
by 0x28F8C22: WorldSession::InitializeSession() (WorldSession.cpp:1185)
by 0x2BA442F: World::AddSession_(WorldSession*) (World.cpp:342)
by 0x2BECD01: World::UpdateSessions(unsigned int) (World.cpp:2962)
by 0x2BEA9F3: World::Update(unsigned int) (World.cpp:2316)
by 0x17F5462: WorldUpdateLoop() (Main.cpp:429)
by 0x17F1BD0: main (Main.cpp:334)
>worldserver.exe!SmartAI::StopPath(unsigned int DespawnTime, unsigned int quest, bool fail) Line 148 C++
worldserver.exe!SmartScript::ProcessAction(SmartScriptHolder & e, Unit * unit, unsigned int var0, unsigned int var1, bool bvar, const SpellInfo * spell, GameObject * gob) Line 1385 C++
worldserver.exe!SmartScript::ProcessEvent(SmartScriptHolder & e, Unit * unit, unsigned int var0, unsigned int var1, bool bvar, const SpellInfo * spell, GameObject * gob) Line 2769 C++
worldserver.exe!SmartScript::ProcessAction(SmartScriptHolder & e, Unit * unit, unsigned int var0, unsigned int var1, bool bvar, const SpellInfo * spell, GameObject * gob) Line 2271 C++
worldserver.exe!SmartScript::ProcessEvent(SmartScriptHolder & e, Unit * unit, unsigned int var0, unsigned int var1, bool bvar, const SpellInfo * spell, GameObject * gob) Line 2769 C++
worldserver.exe!SmartScript::ProcessAction(SmartScriptHolder & e, Unit * unit, unsigned int var0, unsigned int var1, bool bvar, const SpellInfo * spell, GameObject * gob) Line 2271
@jackpoz
jackpoz / Get-LatestScript.ps1
Last active January 14, 2019 11:43
PowerShell script to automate TrinityCore and requirements installation and update
$url = "https://gist.githubusercontent.com/jackpoz/6161c2872d9fd0527f506036ed5c5922/raw/Get-TrinityCore.ps1"
$output = "Get-TrinityCore.ps1"
#Invoke-WebRequest -Uri $url -OutFile $filename
(New-Object System.Net.WebClient).DownloadFile($url, [IO.Path]::Combine((get-location), $output))
@jackpoz
jackpoz / authasan.sh
Created June 13, 2019 10:11
TC test server upgrade
ASAN_OPTIONS=halt_on_error=0:verbosity=1:log_path=authasan/authasan:detect_stack_use_after_return=1 LSAN_OPTIONS=verbosity=1:log_threads=1 ./authserver
@jackpoz
jackpoz / clean bots.sql
Last active August 10, 2019 08:33
clean bots
DELETE FROM auth.account WHERE username LIKE 'bot%' AND username != 'botfarm';
DELETE t FROM auth.realmcharacters AS t LEFT JOIN auth.account AS a ON t.acctid = a.id WHERE a.id IS NULL;
DELETE c FROM characters.characters AS c LEFT JOIN auth.account AS a ON c.account = a.id WHERE a.id IS NULL;
DELETE t FROM characters.character_skills AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_reputation AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_inventory AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_homebind AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_glyphs AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_battleground_data AS t LEFT JOIN characters.characters AS c
==979109==ERROR: AddressSanitizer: stack-use-after-return on address 0x7f633cfdcf6c at pc 0x00000319a495 bp 0x7f633dfdf4d0 sp 0x7f633dfdf4c8
READ of size 4 at 0x7f633cfdcf6c thread T7
#0 0x319a494 in Map::ScriptsProcess() /home/trinity/trinity/sources/src/server/game/Maps/MapScripts.cpp:393:30
#1 0x31a4cbc in Map::ScriptCommandStart(ScriptInfo const&, unsigned int, Object*, Object*) /home/trinity/trinity/sources/src/server/game/Maps/MapScripts.cpp:96:9
#2 0x37c4bd1 in Spell::EffectActivateObject(SpellEffIndex) /home/trinity/trinity/sources/src/server/game/Spells/SpellEffects.cpp:3744:30
#3 0x371b887 in Spell::HandleEffects(Unit*, Item*, GameObject*, unsigned int, SpellEffectHandleMode) /home/trinity/trinity/sources/src/server/game/Spells/Spell.cpp:5036:9
#4 0x371ae38 in Spell::GOTargetInfo::DoTargetSpellHit(Spell*, unsigned char) /home/trinity/trinity/sources/src/server/game/Spells/Spell.cpp:2602:12
#5 0x37598ae in void Spell::DoProcessTargetContainer<std::vector<Spell::GOTargetInfo, s