Giter Club home page Giter Club logo

opendiablo2's People

Contributors

andrejmijic avatar brendanporter avatar cardoso avatar carrelld avatar danhale-git avatar dependabot[bot] avatar drpaneas avatar erexo avatar essial avatar foosoft avatar ganitzsh avatar gravestench avatar grazz avatar griffithsh avatar gucio321 avatar gurkankaymak avatar intyre avatar johnyrose avatar juander-ux avatar leahiel avatar liberodark avatar malavv avatar mewmew avatar ndechiara avatar nicholas-eden avatar presiyan-ivanov avatar stephenhoran avatar thomaschr avatar willroberts avatar ziemas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opendiablo2's Issues

SDL2 Implementation Performance Issues

Currently the SDL2 engine spends a LOT of time creating textures when loading sprites. This is mainly due to the amount of byte by byte operations that take place. I have verified that the MPQ file load functions are relatively quick, but loading that data into textures takes an extremely long time (relatively speaking). We either need to revisit how this data is loaded in, or switch to a pure OpenGL or Vulkan backend at some point in the near future.

Player Game State

We need to add player information to the game state. I propose that we create a PlayerState model in Common, and add an instance of it to GameState (which holds everything about the currently active game). Starting out, the player state object should hold the basic stats (base AND max), the player type, player name, game start time, player x, player y, and map id. Most of these will be empty and defaulted until we get to the point where characters move around.

We also need to read in the starting stats for the hero classes (need to implement that information inside of IEngineDataManager), and assign it to the player on initialization of the game state. Something like PlayerState = new PlayerState(classType, playerName), which is already being passed into the GameState's initialize method.

Animation loading issues

Animations (DC6/COF) are currently taking way too long to cache and way too much memory. We need to make sure to dispose of the loader data once we have loaded everything, and place it in cache somewhere to speed everything up.

Website has invalid SSL cert.

Describe the bug
The SSL cert for opendiablo2.com is invalid.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.opendiablo2.com
  2. Privacy error.

Expected behavior
The website should show, not the SSL browser warning.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Mac/Android
  • Version: Mojave/8.1

Additional context
N/A

Game crashes on last hero deleting

Describe the bug
Game client crashes if I delete the last hero in my saved heroes list

To Reproduce
Steps to reproduce the behavior:

  1. Start game
  2. Create a hero
  3. Restart game
  4. Delete saved hero

Expected behavior
Idk, but I think the game should return to character selection screen

Desktop (please complete the following information):

  • OS: Arch Linux

Additional context

panic: runtime error: index out of range [-1]

goroutine 51 [running]:
github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene.(*CharacterSelect).moveSelectionBox(...)
        /home/averrin/go/src/github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene/character_select.go:218
github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene.(*CharacterSelect).refreshGameStates(0xc006556000)
        /home/averrin/go/src/github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene/character_select.go:285 +0x2aa
github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene.(*CharacterSelect).onDeleteCharacterConfirmClicked(0xc006556000)
        /home/averrin/go/src/github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene/character_select.go:256 +0x75
github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene.(*CharacterSelect).Load.func7.1()
        /home/averrin/go/src/github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene/character_select.go:109 +0x2a
github.com/OpenDiablo2/OpenDiablo2/d2render/d2ui.(*Button).Activate(0xc0065565c8)
        /home/averrin/go/src/github.com/OpenDiablo2/OpenDiablo2/d2render/d2ui/button.go:180 +0x31
github.com/OpenDiablo2/OpenDiablo2/d2render/d2ui.(*Manager).Update(0xc0005040d0)
        /home/averrin/go/src/github.com/OpenDiablo2/OpenDiablo2/d2render/d2ui/manager.go:129 +0x4d2
github.com/OpenDiablo2/OpenDiablo2/d2core.(*Engine).Update(0xe6a080)
        /home/averrin/go/src/github.com/OpenDiablo2/OpenDiablo2/d2core/engine.go:214 +0x205
main.update(0xc001462680, 0x4480000000000000, 0x4300000000000000)
        /home/averrin/go/src/github.com/OpenDiablo2/OpenDiablo2/main.go:54 +0x42
github.com/hajimehoshi/ebiten.(*imageDumper).update(0xc001462580, 0xc001462680, 0xe87560, 0xc0011002e0)
        /home/averrin/go/pkg/mod/github.com/hajimehoshi/[email protected]/imagedumper_desktop.go:105 +0x4e
github.com/hajimehoshi/ebiten.(*uiContext).Update(0xc0014625c0, 0xc00a937220, 0x0, 0x0)
        /home/averrin/go/pkg/mod/github.com/hajimehoshi/[email protected]/uicontext.go:93 +0x14b
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).update(0xb1b780, 0x8da4a0, 0xc0014625c0, 0x0, 0x0)
        /home/averrin/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:793 +0x1d6
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).loop(0xb1b780, 0x8da4a0, 0xc0014625c0, 0x0, 0x0)
        /home/averrin/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:821 +0x9f
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).run(0xb1b780, 0x320, 0x258, 0x3ff0000000000000, 0xc000aa0040, 0x1a, 0x8da4a0, 0xc0014625c0, 0xc0005fe000, 0xffffffffffffffff)
        /home/averrin/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:693 +0x165
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run.func1(0xc000012020, 0xc000078240, 0xb1b780, 0x320, 0x258, 0x3ff0000000000000, 0xc000aa0040, 0x1a, 0x8da4a0, 0xc0014625c0)
        /home/averrin/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:573 +0x10b
created by github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run
        /home/averrin/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:570 +0x1c8

Travis CI Not working

Just putting a placeholder here. A few days back TravisCI suddenly lost the ability to deploy releases to Github. I have no idea what the issue is currently.

fix golint warnings

Running golint ./... on the OpenDiablo2 code base reports a few issues that could be fixed to make the code more idiomatic Go, or simply to improve documentation, etc.

I've categorized the issues reported by golint below:

Don't used MixedCaps in package names

I understand that the OpenDiablo2 project has its roots in a C# code base, and as such, the naming conventions used for package names make sense.

In Go, the convention is to use lowercase names for package imports. This is especially true after moving to using Go modules (but that's another story).

I've listed the issues reported by golint below, but they are rather obvious :)

Common/AnimatedEntity.go:1:1: don't use MixedCaps in package name; Common should be common
Common/AnimationData.go:1:1: don't use MixedCaps in package name; Common should be common
Common/BitMuncher.go:1:1: don't use MixedCaps in package name; Common should be common
Common/BitStream.go:1:1: don't use MixedCaps in package name; Common should be common
Common/BitStream_test.go:1:1: don't use MixedCaps in package name; Common should be common
Common/BuildInfo.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Cof.go:1:1: don't use MixedCaps in package name; Common should be common
Common/ColorConvert.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Dcc.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Drawable.go:1:1: don't use MixedCaps in package name; Common should be common
Common/FileProvider.go:1:1: don't use MixedCaps in package name; Common should be common
Common/GameState.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Hero.go:1:1: don't use MixedCaps in package name; Common should be common
Common/LevelPresets.go:1:1: don't use MixedCaps in package name; Common should be common
Common/LevelTypes.go:1:1: don't use MixedCaps in package name; Common should be common
Common/LevelWarp.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Math.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Missiles.go:1:1: don't use MixedCaps in package name; Common should be common
Common/MpqFileRecord.go:1:1: don't use MixedCaps in package name; Common should be common
Common/ObjectLookup.go:1:1: don't use MixedCaps in package name; Common should be common
Common/ObjectTypes.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Objects.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Palette.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Rectangle.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Sounds.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Sprite.go:1:1: don't use MixedCaps in package name; Common should be common
Common/StreamReader.go:1:1: don't use MixedCaps in package name; Common should be common
Common/StreamReader_test.go:1:1: don't use MixedCaps in package name; Common should be common
Common/StreamWriter.go:1:1: don't use MixedCaps in package name; Common should be common
Common/StreamWriter_test.go:1:1: don't use MixedCaps in package name; Common should be common
Common/StringUtils.go:1:1: don't use MixedCaps in package name; Common should be common
Common/TextDictionary.go:1:1: don't use MixedCaps in package name; Common should be common
Common/Weapons.go:1:1: don't use MixedCaps in package name; Common should be common
Compression/Huffman.go:30:1: don't use MixedCaps in package name; Compression should be compression
Compression/Wav.go:1:1: don't use MixedCaps in package name; Compression should be compression
Core/Engine.go:1:1: don't use MixedCaps in package name; Core should be core
MPQ/CryptoBuff.go:1:1: don't use MixedCaps in package name; MPQ should be mpq
MPQ/MPQ.go:1:1: don't use MixedCaps in package name; MPQ should be mpq
MPQ/MPQStream.go:1:1: don't use MixedCaps in package name; MPQ should be mpq
Map/DS1.go:1:1: don't use MixedCaps in package name; Map should be map
Map/DT1.go:1:1: don't use MixedCaps in package name; Map should be map
Map/Engine.go:1:1: don't use MixedCaps in package name; Map should be map
Map/Orientation.go:1:1: don't use MixedCaps in package name; Map should be map
Map/Region.go:1:1: don't use MixedCaps in package name; Map should be map
PaletteDefs/PaletteDefs.go:1:1: don't use MixedCaps in package name; PaletteDefs should be palettedefs
ResourcePaths/ResourcePaths.go:1:1: don't use MixedCaps in package name; ResourcePaths should be resourcepaths
Scenes/BlizzardIntro.go:1:1: don't use MixedCaps in package name; Scenes should be scenes
Scenes/CharacterSelect.go:1:1: don't use MixedCaps in package name; Scenes should be scenes
Scenes/Credits.go:1:1: don't use MixedCaps in package name; Scenes should be scenes
Scenes/MainMenu.go:1:1: don't use MixedCaps in package name; Scenes should be scenes
Scenes/MapEngineTest.go:1:1: don't use MixedCaps in package name; Scenes should be scenes
Scenes/Scene.go:1:1: don't use MixedCaps in package name; Scenes should be scenes
Scenes/SceneProvider.go:1:1: don't use MixedCaps in package name; Scenes should be scenes
Scenes/SelectHeroClass.go:1:1: don't use MixedCaps in package name; Scenes should be scenes
Sound/AudioProvider.go:1:1: don't use MixedCaps in package name; Sound should be sound
Sound/SoundEffect.go:1:1: don't use MixedCaps in package name; Sound should be sound
UI/Button.go:1:1: don't use MixedCaps in package name; UI should be ui
UI/Font.go:1:1: don't use MixedCaps in package name; UI should be ui
UI/Label.go:1:1: don't use MixedCaps in package name; UI should be ui
UI/Manager.go:1:1: don't use MixedCaps in package name; UI should be ui
UI/Widget.go:1:1: don't use MixedCaps in package name; UI should be ui
Video/BinkDecoder.go:1:1: don't use MixedCaps in package name; Video should be video

Miscelaneous issues

Common/Palette.go:14:1: comment on exported type PaletteRec should be of the form "PaletteRec ..." (with optional leading article)
Common/StreamReader.go:131:24: method Eof should be EOF
Compression/Huffman.go:1:1: package comment should be of the form "Package Compression ..."
Compression/Huffman.go:48:46: exported func CreateLinkedNode returns unexported type *Compression.linkedNode, which can be annoying to use
Sound/SoundEffect.go:13:6: type name will be used as Sound.SoundEffect by other packages, and that stutters; consider calling this Effect

Id should be ID in declaration names

Common/LevelPresets.go:12:2: struct field DefinitionId should be DefinitionID
Common/LevelPresets.go:13:2: struct field LevelId should be LevelID
Common/LevelTypes.go:12:2: struct field Id should be ID
Common/LevelWarp.go:10:2: struct field Id should be ID
Common/Missiles.go:75:2: struct field Id should be ID
Common/ObjectLookup.go:18:2: struct field Id should be ID
Common/ObjectLookup.go:20:2: struct field ObjectsTxtId should be ObjectsTxtID
Common/ObjectLookup.go:21:2: struct field MonstatsTxtId should be MonstatsTxtID
Common/Objects.go:14:2: struct field Id should be ID
Map/DS1.go:77:2: struct field Id should be ID
Map/Region.go:46:6: type RegionIdType should be RegionIDType
Video/BinkDecoder.go:32:2: struct field AudioTrackId should be AudioTrackID

Missing comments on exported declaration

main.go:16:5: exported var GitBranch should have comment or be unexported
main.go:17:5: exported var GitCommit should have comment or be unexported
Common/AnimatedEntity.go:13:6: exported type AnimatedEntity should have comment or be unexported
Common/AnimatedEntity.go:33:1: exported function CreateAnimatedEntity should have comment or be unexported
Common/AnimatedEntity.go:43:5: exported var DirectionLookup should have comment or be unexported
Common/AnimatedEntity.go:45:1: exported method AnimatedEntity.SetMode should have comment or be unexported
Common/AnimatedEntity.go:56:1: exported method AnimatedEntity.Render should have comment or be unexported
Common/AnimationData.go:10:6: exported type AnimationDataRecord should have comment or be unexported
Common/AnimationData.go:17:5: exported var AnimationData should have comment or be unexported
Common/AnimationData.go:19:1: exported function LoadAnimationData should have comment or be unexported
Common/BitMuncher.go:3:6: exported type BitMuncher should have comment or be unexported
Common/BitMuncher.go:9:1: exported function CreateBitMuncher should have comment or be unexported
Common/BitMuncher.go:17:1: exported function CopyBitMuncher should have comment or be unexported
Common/BitMuncher.go:25:1: exported method BitMuncher.GetBit should have comment or be unexported
Common/BitMuncher.go:32:1: exported method BitMuncher.SkipBits should have comment or be unexported
Common/BitMuncher.go:36:1: exported method BitMuncher.GetByte should have comment or be unexported
Common/BitMuncher.go:40:1: exported method BitMuncher.GetInt32 should have comment or be unexported
Common/BitMuncher.go:44:1: exported method BitMuncher.GetUInt32 should have comment or be unexported
Common/BitMuncher.go:48:1: exported method BitMuncher.GetBits should have comment or be unexported
Common/BitMuncher.go:59:1: exported method BitMuncher.GetSignedBits should have comment or be unexported
Common/BitMuncher.go:63:1: exported method BitMuncher.MakeSigned should have comment or be unexported
Common/BuildInfo.go:3:6: exported type BuildInfoRecord should have comment or be unexported
Common/BuildInfo.go:8:5: exported var BuildInfo should have comment or be unexported
Common/BuildInfo.go:10:1: exported function SetBuildInfo should have comment or be unexported
Common/Cof.go:5:6: exported type AnimationMode should have comment or be unexported
Common/Cof.go:8:2: exported const AnimationModePlayerDeath should have comment (or a comment on this block) or be unexported
Common/Cof.go:54:5: exported var AnimationModeStr should have comment or be unexported
Common/Cof.go:101:6: exported type CompositeType should have comment or be unexported
Common/Cof.go:104:2: exported const CompositeTypeHead should have comment (or a comment on this block) or be unexported
Common/Cof.go:123:6: exported type DrawEffect should have comment or be unexported
Common/Cof.go:126:2: exported const DrawEffectPctTransparency75 should have comment (or a comment on this block) or be unexported
Common/Cof.go:134:6: exported type WeaponClass should have comment or be unexported
Common/Cof.go:137:2: exported const WeaponClassNone should have comment (or a comment on this block) or be unexported
Common/Cof.go:154:5: exported var WeaponClassStr should have comment or be unexported
Common/Cof.go:172:1: exported function GetWeaponClass should have comment or be unexported
Common/Cof.go:182:6: exported type AnimationFrame should have comment or be unexported
Common/Cof.go:185:2: exported const AnimationFrameNoEvent should have comment (or a comment on this block) or be unexported
Common/Cof.go:192:6: exported type CofLayer should have comment or be unexported
Common/Cof.go:200:6: exported type Cof should have comment or be unexported
Common/Cof.go:210:1: exported function LoadCof should have comment or be unexported
Common/Dcc.go:7:6: exported type DCCPixelBufferEntry should have comment or be unexported
Common/Dcc.go:13:6: exported type DCCCell should have comment or be unexported
Common/Dcc.go:24:6: exported type DCCDirectionFrame should have comment or be unexported
Common/Dcc.go:39:6: exported type DCCDirection should have comment or be unexported
Common/Dcc.go:63:6: exported type DCC should have comment or be unexported
Common/Dcc.go:74:1: exported function CreateDCCDirectionFrame should have comment or be unexported
Common/Dcc.go:93:1: exported method DCCDirectionFrame.CalculateCells should have comment or be unexported
Common/Dcc.go:154:1: exported function CreateDCCDirection should have comment or be unexported
Common/Dcc.go:250:1: exported method DCCDirection.GenerateFrames should have comment or be unexported
Common/Dcc.go:341:1: exported method DCCDirection.FillPixelBuffer should have comment or be unexported
Common/Dcc.go:451:1: exported method DCCDirection.CalculateCells should have comment or be unexported
Common/Dcc.go:493:1: exported function LoadDCC should have comment or be unexported
Common/GameState.go:8:6: exported type GameState should have comment or be unexported
Common/GameState.go:12:1: exported function CreateGameState should have comment or be unexported
Common/GameState.go:19:1: exported function LoadGameState should have comment or be unexported
Common/Hero.go:3:6: exported type Hero should have comment or be unexported
Common/Hero.go:6:2: exported const HeroNone should have comment (or a comment on this block) or be unexported
Common/LevelPresets.go:10:6: exported type LevelPresetRecord should have comment or be unexported
Common/LevelPresets.go:72:5: exported var LevelPresets should have comment or be unexported
Common/LevelPresets.go:74:1: exported function LoadLevelPresets should have comment or be unexported
Common/LevelTypes.go:10:6: exported type LevelTypeRecord should have comment or be unexported
Common/LevelTypes.go:19:5: exported var LevelTypes should have comment or be unexported
Common/LevelTypes.go:21:1: exported function LoadLevelTypes should have comment or be unexported
Common/LevelWarp.go:9:6: exported type LevelWarpRecord should have comment or be unexported
Common/LevelWarp.go:24:5: exported var LevelWarps should have comment or be unexported
Common/LevelWarp.go:26:1: exported function LoadLevelWarps should have comment or be unexported
Common/Math.go:27:1: exported function NextPow2 should have comment or be unexported
Common/Math.go:35:1: exported function AbsInt32 should have comment or be unexported
Common/Math.go:56:1: exported function IsoToScreen should have comment or be unexported
Common/Math.go:62:1: exported function ScreenToIso should have comment or be unexported
Common/Missiles.go:10:6: exported type MissileCalcParam should have comment or be unexported
Common/Missiles.go:15:6: exported type MissileCalc should have comment or be unexported
Common/Missiles.go:21:6: exported type MissileLight should have comment or be unexported
Common/Missiles.go:29:6: exported type MissileAnimation should have comment or be unexported
Common/Missiles.go:43:6: exported type MissileCollision should have comment or be unexported
Common/Missiles.go:57:6: exported type MissileDamage should have comment or be unexported
Common/Missiles.go:66:6: exported type MissileElementalDamage should have comment or be unexported
Common/Missiles.go:73:6: exported type MissileRecord should have comment or be unexported
Common/Missiles.go:292:5: exported var Missiles should have comment or be unexported
Common/Missiles.go:294:1: exported function LoadMissiles should have comment or be unexported
Common/MpqFileRecord.go:3:6: exported type MpqFileRecord should have comment or be unexported
Common/ObjectLookup.go:8:6: exported type ObjectType should have comment or be unexported
Common/ObjectLookup.go:11:2: exported const ObjectTypeCharacter should have comment (or a comment on this block) or be unexported
Common/ObjectLookup.go:15:6: exported type ObjectLookupRecord should have comment or be unexported
Common/ObjectLookup.go:47:5: exported var ObjectLookups should have comment or be unexported
Common/ObjectLookup.go:49:1: exported function LoadObjectLookups should have comment or be unexported
Common/ObjectLookup.go:95:1: exported function LookupObject should have comment or be unexported
Common/ObjectTypes.go:10:6: exported type ObjectTypeRecord should have comment or be unexported
Common/ObjectTypes.go:15:5: exported var ObjectTypes should have comment or be unexported
Common/ObjectTypes.go:17:1: exported function LoadObjectTypes should have comment or be unexported
Common/Objects.go:336:5: exported var Objects should have comment or be unexported
Common/Objects.go:338:1: exported function LoadObjects should have comment or be unexported
Common/Palette.go:20:5: exported var Palettes should have comment or be unexported
Common/Palette.go:36:1: exported function LoadPalettes should have comment or be unexported
Common/Rectangle.go:3:6: exported type Rectangle should have comment or be unexported
Common/Rectangle.go:10:1: exported method Rectangle.Bottom should have comment or be unexported
Common/Rectangle.go:14:1: exported method Rectangle.Right should have comment or be unexported
Common/Rectangle.go:18:1: exported method Rectangle.IsInRect should have comment or be unexported
Common/Sounds.go:72:5: exported var Sounds should have comment or be unexported
Common/Sounds.go:74:1: exported function LoadSounds should have comment or be unexported
Common/Sprite.go:167:1: exported method Sprite.ResetAnimation should have comment or be unexported
Common/Sprite.go:172:1: exported method Sprite.OnLastFrame should have comment or be unexported
Common/StreamReader.go:61:1: exported method StreamReader.SetPosition should have comment or be unexported
Common/StreamReader.go:113:1: exported method StreamReader.SkipBytes should have comment or be unexported
Common/StreamReader.go:131:1: exported method StreamReader.Eof should have comment or be unexported
Common/StringUtils.go:88:1: exported function Utf16BytesToString should have comment or be unexported
Common/StringUtils.go:111:1: exported function CombineStrings should have comment or be unexported
Common/StringUtils.go:115:1: exported function SplitIntoLinesWithMaxWidth should have comment or be unexported
Common/TextDictionary.go:21:1: exported function TranslateString should have comment or be unexported
Common/TextDictionary.go:29:1: exported function LoadTextDictionary should have comment or be unexported
Common/Weapons.go:10:6: exported type WeaponRecord should have comment or be unexported
Common/Weapons.go:114:6: exported type WeaponVendorParams should have comment or be unexported
Common/Weapons.go:267:5: exported var Weapons should have comment or be unexported
Common/Weapons.go:269:1: exported function LoadWeapons should have comment or be unexported
Compression/Huffman.go:48:1: exported function CreateLinkedNode should have comment or be unexported
Compression/Huffman.go:337:1: exported function HuffmanDecompress should have comment or be unexported
Compression/Wav.go:29:1: exported function WavDecompress should have comment or be unexported
Core/Engine.go:240:1: exported method Engine.LoadFile should have comment or be unexported
MPQ/MPQ.go:45:6: exported type PatchInfo should have comment or be unexported
MPQ/MPQ.go:244:1: exported method MPQ.FileExists should have comment or be unexported
Map/DS1.go:13:6: exported type LayerStreamType should have comment or be unexported
Map/DS1.go:16:2: exported const LayerStreamWall1 should have comment (or a comment on this block) or be unexported
Map/DS1.go:30:6: exported type FloorShadowRecord should have comment or be unexported
Map/DS1.go:39:6: exported type WallRecord should have comment or be unexported
Map/DS1.go:50:6: exported type SubstitutionRecord should have comment or be unexported
Map/DS1.go:54:6: exported type TileRecord should have comment or be unexported
Map/DS1.go:61:6: exported type SubstitutionGroup should have comment or be unexported
Map/DS1.go:69:6: exported type Path should have comment or be unexported
Map/DS1.go:75:6: exported type Object should have comment or be unexported
Map/DS1.go:85:6: exported type DS1 should have comment or be unexported
Map/DS1.go:102:1: exported function LoadDS1 should have comment or be unexported
Map/DT1.go:11:6: exported type Block should have comment or be unexported
Map/DT1.go:22:6: exported type Tile should have comment or be unexported
Map/DT1.go:39:6: exported type DT1 should have comment or be unexported
Map/DT1.go:43:6: exported type BlockDataFormat should have comment or be unexported
Map/DT1.go:46:2: exported const BlockFormatRLE should have comment (or a comment on this block) or be unexported
Map/DT1.go:50:1: exported function LoadDT1 should have comment or be unexported
Map/Engine.go:12:6: exported type EngineRegion should have comment or be unexported
Map/Engine.go:17:6: exported type Engine should have comment or be unexported
Map/Engine.go:26:1: exported function CreateMapEngine should have comment or be unexported
Map/Engine.go:36:1: exported method Engine.GenerateMap should have comment or be unexported
Map/Engine.go:46:1: exported method Engine.GetRegionAt should have comment or be unexported
Map/Engine.go:59:1: exported method Engine.Render should have comment or be unexported
Map/Orientation.go:3:6: exported type Orientation should have comment or be unexported
Map/Orientation.go:6:2: exported const Floors should have comment (or a comment on this block) or be unexported
Map/Region.go:18:6: exported type TileCacheRecord should have comment or be unexported
Map/Region.go:24:6: exported type Region should have comment or be unexported
Map/Region.go:38:6: exported type RegionLayerType should have comment or be unexported
Map/Region.go:41:2: exported const RegionLayerTypeFloors should have comment (or a comment on this block) or be unexported
Map/Region.go:46:6: exported type RegionIdType should have comment or be unexported
Map/Region.go:49:2: exported const RegionAct1Town should have comment (or a comment on this block) or be unexported
Map/Region.go:86:1: exported function LoadRegion should have comment or be unexported
Map/Region.go:148:1: exported method Region.RenderTile should have comment or be unexported
ResourcePaths/ResourcePaths.go:3:5: exported var LanguageCode should have comment or be unexported
ResourcePaths/ResourcePaths.go:8:2: exported const LoadingScreen should have comment (or a comment on this block) or be unexported
Scenes/BlizzardIntro.go:9:6: exported type BlizzardIntro should have comment or be unexported
Scenes/BlizzardIntro.go:15:1: exported function CreateBlizzardIntro should have comment or be unexported
Scenes/BlizzardIntro.go:24:1: exported method BlizzardIntro.Load should have comment or be unexported
Scenes/BlizzardIntro.go:33:1: exported method BlizzardIntro.Unload should have comment or be unexported
Scenes/BlizzardIntro.go:37:1: exported method BlizzardIntro.Render should have comment or be unexported
Scenes/BlizzardIntro.go:41:1: exported method BlizzardIntro.Update should have comment or be unexported
Scenes/CharacterSelect.go:12:6: exported type CharacterSelect should have comment or be unexported
Scenes/CharacterSelect.go:25:1: exported function CreateCharacterSelect should have comment or be unexported
Scenes/CharacterSelect.go:40:1: exported method CharacterSelect.Load should have comment or be unexported
Scenes/CharacterSelect.go:90:1: exported method CharacterSelect.Unload should have comment or be unexported
Scenes/CharacterSelect.go:93:1: exported method CharacterSelect.Render should have comment or be unexported
Scenes/CharacterSelect.go:97:1: exported method CharacterSelect.Update should have comment or be unexported
Scenes/MapEngineTest.go:15:6: exported type MapEngineTest should have comment or be unexported
Scenes/MapEngineTest.go:24:1: exported function CreateMapEngineTest should have comment or be unexported
Scenes/MapEngineTest.go:39:1: exported method MapEngineTest.Load should have comment or be unexported
Scenes/MapEngineTest.go:65:1: exported method MapEngineTest.Unload should have comment or be unexported
Scenes/MapEngineTest.go:69:1: exported method MapEngineTest.Render should have comment or be unexported
Scenes/MapEngineTest.go:85:1: exported method MapEngineTest.Update should have comment or be unexported
Scenes/SelectHeroClass.go:14:6: exported type HeroStance should have comment or be unexported
Scenes/SelectHeroClass.go:17:2: exported const HeroStanceIdle should have comment (or a comment on this block) or be unexported
Scenes/SelectHeroClass.go:24:6: exported type HeroRenderInfo should have comment or be unexported
Scenes/SelectHeroClass.go:39:6: exported type SelectHeroClass should have comment or be unexported
Scenes/SelectHeroClass.go:56:1: exported function CreateSelectHeroClass should have comment or be unexported
Scenes/SelectHeroClass.go:72:1: exported method SelectHeroClass.Load should have comment or be unexported
Scenes/SelectHeroClass.go:365:1: exported method SelectHeroClass.Unload should have comment or be unexported
Scenes/SelectHeroClass.go:373:1: exported method SelectHeroClass.Render should have comment or be unexported
Scenes/SelectHeroClass.go:395:1: exported method SelectHeroClass.Update should have comment or be unexported
Sound/AudioProvider.go:74:1: exported method Manager.LoadSoundEffect should have comment or be unexported
Sound/AudioProvider.go:79:1: exported method Manager.SetVolumes should have comment or be unexported
Sound/SoundEffect.go:13:6: exported type SoundEffect should have comment or be unexported
Sound/SoundEffect.go:17:1: exported function CreateSoundEffect should have comment or be unexported
Sound/SoundEffect.go:41:1: exported method SoundEffect.Play should have comment or be unexported
Sound/SoundEffect.go:46:1: exported method SoundEffect.Stop should have comment or be unexported
UI/Button.go:17:2: exported const ButtonTypeWide should have comment (or a comment on this block) or be unexported
UI/Manager.go:57:1: exported method Manager.WaitForMouseRelease should have comment or be unexported
UI/Manager.go:146:1: exported method Manager.KeyPressed should have comment or be unexported
Video/BinkDecoder.go:9:6: exported type BinkVideoMode should have comment or be unexported
Video/BinkDecoder.go:12:2: exported const BinkVideoModeNormal should have comment (or a comment on this block) or be unexported
Video/BinkDecoder.go:20:6: exported type BinkAudioAlgorithm should have comment or be unexported
Video/BinkDecoder.go:23:2: exported const BinkAudioAlgorithmFFT should have comment (or a comment on this block) or be unexported
Video/BinkDecoder.go:27:6: exported type BinkAudioTrack should have comment or be unexported
Video/BinkDecoder.go:35:6: exported type BinkDecoder should have comment or be unexported
Video/BinkDecoder.go:53:1: exported function CreateBinkDecoder should have comment or be unexported
Video/BinkDecoder.go:61:1: exported method BinkDecoder.GetNextFrame should have comment or be unexported

Character Renderer layer order

Currently, the character renderer sometimes renders the layers in an improper order. This can cause things like shoulders rendering over bodies, or arms rendering in front of the character instead of behind them. This is most likely caused by something in the SDL2CharacterRenderer.cs file.

We need a website

If you're good at doing websites, this is a perfect way to contribute! We need a website set up for this project. There will be downloads available soon so make a space for that as well. I don't really care what it looks like, as long as it doesn't look too terrible.

Language Dictionary

We need to load language dictionary files in so we can produce an ITextProvider interface with the singular method GetText(key) that returns the value of whatever that key is. These language files are in plain text inside the MPQ files.

Map rendering loop

Is your feature request related to a problem? Please describe.
Currently the map engine runs through every tile of every region on the map render loop. It should simply run through x/y tiles once, for the tiles 'visible' on the screen (keeping in mind the verticality of some tiles on the Y axis).

Describe the solution you'd like
We need to do one x/y render loop that does a square around the viewport and picks tiles from the last region in the region list that has a tile at that location.

Additional context
As we add more and more regions to map generation, the rendering is going to become incredibly slow until this change is made.

Select Character Screen

We need to implement the the basics of the Select Character screen as it is in the original D2 game. When starting a game, it should jumps straight to the select hero screen as it does in D2 when there are no characters. When you click back, it should instead take you to the select character screen, which you should then be able to navigate back to the main menu, or back to the hero select screen. Adding logic to show existing games is not necessary at this point as there are no existing games to show.

scrolling is super quick when first entering the map test

Describe the bug
If you enter the map test and then try to scroll, sometimes the scroll is really quick and not smooth as it should be. After the first few seconds of the game, then scrolling is always smooth.

I think this is an issue with the calculation of delta time used for scrolling. Where perhaps a lot of time has passed for the first scroll interaction.

Note, this is on rev a105bb3

Linux/Mono Support

Currently this engine only runs in Windows. We need to port it to run on Mono/Linux as well.

Credits Screen

We need create a credits screen. It should currently load the credits file from data\local\ui\eng\ExpansionCredits.txt and display it as it does in the original D2 client. Eventually we need to add a space for the developers of this client, and separate the two somehow in the scroll.

Credits screen line spacing wrong

The spacing between the lines in the credits screen does not match the official D2 client. The spacing needs to be adjusted to accurately match what the original client does.

Intro Video Scene

We need to add the intro video scene to play the intro videos that start before the game does (the logo stuff). ffmpeg is capable of playing bink format videos so this should not be a problem. We can either find a C# .net wrapper for ffmpeg, or write our own simple wrapper.

Now crash on linux

Describe the bug
With the last commit a6a9434 the OpenD2 is crashing.

To Reproduce
Just run the executable

Expected behavior

2019/11/12 07:08:21.437857 /home/pc/D2-GO/OpenDiablo2-master/main.go:35: OpenDiablo2 - Open source Diablo 2 engine
2019/11/12 07:08:21.440717 /home/pc/D2-GO/OpenDiablo2-master/d2core/engine.go:92: Loading configuration file
2019/11/12 07:08:21.461131 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/palette.go:49: Loaded 18 palettes
2019/11/12 07:08:21.480458 /home/pc/D2-GO/OpenDiablo2-master/d2common/text_dictionary.go:36: Loaded 9086 entries from the string table
2019/11/12 07:08:21.480636 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/level_types.go:54: Loaded 38 LevelType records
2019/11/12 07:08:21.482377 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/level_presets.go:92: Loaded 1091 level presets
2019/11/12 07:08:21.482931 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/level_warp.go:52: Loaded 83 level warps
2019/11/12 07:08:21.484068 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/object_types.go:34: Loaded 573 object types
2019/11/12 07:08:21.488566 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/objects.go:356: Loaded 571 objects
2019/11/12 07:08:21.491770 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/weapons.go:288: Loaded 307 weapons
2019/11/12 07:08:21.494876 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/armor.go:281: Loaded 203 armors
2019/11/12 07:08:21.497501 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/unique_items.go:136: Loaded 352 unique items
2019/11/12 07:08:21.502448 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/missiles.go:308: Loaded 684 missiles
2019/11/12 07:08:21.512115 /home/pc/D2-GO/OpenDiablo2-master/d2data/d2datadict/sounds.go:106: Loaded 4699 sound definitions
2019/11/12 07:08:21.519777 /home/pc/D2-GO/OpenDiablo2-master/d2data/animation_data.go:51: Loaded 3529 animation data records
2019/11/12 07:08:24.617279 /home/pc/D2-GO/OpenDiablo2-master/d2core/game_state.go:125: mkdir /home/pc/.OpenDiablo2/Saves: permission denied
panic: mkdir /home/pc/.OpenDiablo2/Saves: permission denied

goroutine 10 [running]:
log.Panicf(0xc00123c7c0, 0x34, 0x0, 0x0, 0x0)
	/usr/lib/go/src/log/log.go:345 +0xc0
github.com/OpenDiablo2/OpenDiablo2/d2core.getGameBaseSavePath(0xc00844e120, 0xc000a29828)
	/home/pc/D2-GO/OpenDiablo2-master/d2core/game_state.go:125 +0x120
github.com/OpenDiablo2/OpenDiablo2/d2core.HasGameStates(0xe6a080)
	/home/pc/D2-GO/OpenDiablo2-master/d2core/game_state.go:41 +0x22
github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene.(*MainMenu).onSinglePlayerClicked(0xc001e24000)
	/home/pc/D2-GO/OpenDiablo2-master/d2core/d2scene/main_menu.go:207 +0x34
github.com/OpenDiablo2/OpenDiablo2/d2core/d2scene.(*MainMenu).Load.func15.1()
	/home/pc/D2-GO/OpenDiablo2-master/d2core/d2scene/main_menu.go:162 +0x2a
github.com/OpenDiablo2/OpenDiablo2/d2render/d2ui.(*Button).Activate(0xc001e24360)
	/home/pc/D2-GO/OpenDiablo2-master/d2render/d2ui/button.go:180 +0x31
github.com/OpenDiablo2/OpenDiablo2/d2render/d2ui.(*Manager).Update(0xc0007bedd0)
	/home/pc/D2-GO/OpenDiablo2-master/d2render/d2ui/manager.go:129 +0x4d2
github.com/OpenDiablo2/OpenDiablo2/d2core.(*Engine).Update(0xe6a080)
	/home/pc/D2-GO/OpenDiablo2-master/d2core/engine.go:214 +0x205
main.update(0xc001bd4680, 0x0, 0x1)
	/home/pc/D2-GO/OpenDiablo2-master/main.go:54 +0x42
github.com/hajimehoshi/ebiten.(*imageDumper).update(0xc001bd4580, 0xc001bd4680, 0xe87560, 0xc00000f740)
	/home/pc/go/pkg/mod/github.com/hajimehoshi/[email protected]/imagedumper_desktop.go:105 +0x4e
github.com/hajimehoshi/ebiten.(*uiContext).Update(0xc001bd45c0, 0xc0083ad6a0, 0x0, 0x0)
	/home/pc/go/pkg/mod/github.com/hajimehoshi/[email protected]/uicontext.go:93 +0x14b
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).update(0xb1b780, 0x8da4c0, 0xc001bd45c0, 0x0, 0x0)
	/home/pc/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:793 +0x1d6
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).loop(0xb1b780, 0x8da4c0, 0xc001bd45c0, 0x0, 0x0)
	/home/pc/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:821 +0x9f
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).run(0xb1b780, 0x320, 0x258, 0x3ff0000000000000, 0xc0008bc000, 0x1a, 0x8da4c0, 0xc001bd45c0, 0xc0006ba120, 0xffffffffffffffff)
	/home/pc/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:693 +0x165
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run.func1(0xc001be8010, 0xc001bea1e0, 0xb1b780, 0x320, 0x258, 0x3ff0000000000000, 0xc0008bc000, 0x1a, 0x8da4c0, 0xc001bd45c0)
	/home/pc/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:573 +0x10b
created by github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run
	/home/pc/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:570 +0x1c8

Desktop (please complete the following information):

  • OS: Manjaro
  • Version XFCE

Text entry UI element

Is your feature request related to a problem? Please describe.
We need the text entry UI element created for the hero select screen. It needs to work and act exactly as it does in the official D2 client.

Occasional Image Artifacts

There seems to be random times where the buttons in the game do not load right. I'm guessing this is an issue with threading and ebiten. Either way, this needs to be tracked down as it is highly annoying.
image

panic: runtime error: invalid memory address or nil pointer dereference

Describe the bug
->Be me
->Try to run the binary
->After the load of the animations, I get an error
->panic: runtime error: invalid memory address or nil pointer dereference

To Reproduce
Steps to reproduce the behavior:

  1. Run the binary
  2. Wait
  3. See the error

Logs

2019/11/09 20:48:32.810807 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/main.go:32: OpenDiablo2 - Open source Diablo 2 engine
2019/11/09 20:48:32.833111 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/core/Engine.go:78: Loading configuration file
2019/11/09 20:48:33.048075 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/Palette.go:47: Loaded 18 palettes
2019/11/09 20:48:33.169596 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/TextDictionary.go:35: Loaded 9094 entries from the string table
2019/11/09 20:48:33.170926 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/LevelTypes.go:50: Loaded 38 LevelType records
2019/11/09 20:48:33.185066 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/LevelPresets.go:88: Loaded 1091 level presets
2019/11/09 20:48:33.188981 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/LevelWarp.go:48: Loaded 83 level warps
2019/11/09 20:48:33.197970 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/ObjectTypes.go:30: Loaded 573 object types
2019/11/09 20:48:33.230309 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/Objects.go:352: Loaded 571 objects
2019/11/09 20:48:33.264607 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/Weapons.go:284: Loaded 307 weapons
2019/11/09 20:48:33.280567 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/Armor.go:277: Loaded 203 armors
2019/11/09 20:48:33.294038 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/UniqueItems.go:132: Loaded 352 unique items
2019/11/09 20:48:33.343685 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/Missiles.go:304: Loaded 684 missiles
2019/11/09 20:48:33.433119 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/Sounds.go:102: Loaded 4699 sound definitions
2019/11/09 20:48:33.496098 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/ObjectLookup.go:92: Loaded 7892 object lookups
2019/11/09 20:48:33.564282 $HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/common/AnimationData.go:47: Loaded 3529 animation data records
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x554e7e]

goroutine 1 [running, locked to thread]:
github.com/hajimehoshi/ebiten/internal/glfw.(*Window).ShouldClose(...)
	$HOME/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/glfw/glfw_notwindows.go:206
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).update.func1(0xc00041a060, 0x0)
	$HOME/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:757 +0x2e
github.com/hajimehoshi/ebiten/internal/thread.(*Thread).Call.func1()
	$HOME/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/thread/thread.go:57 +0x38
github.com/hajimehoshi/ebiten/internal/thread.(*Thread).Loop(0xc000092078, 0x96a5c0, 0xc0020dc600)
	$HOME/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/thread/thread.go:43 +0x3b
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run(0xba25e0, 0x320, 0x258, 0x3ff0000000000000, 0xc0004a4020, 0x1a, 0x96a900, 0xc0020dc5c0, 0x96e460, 0xbde6c0, ...)
	$HOME/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:579 +0x20a
github.com/hajimehoshi/ebiten.Run(0x8fd6f0, 0x320, 0x258, 0x3ff0000000000000, 0xc0004a4020, 0x1a, 0x1, 0xc0004a4020)
	$HOME/go/pkg/mod/github.com/hajimehoshi/[email protected]/run.go:141 +0x164
main.main()
	$HOME/go/src/github.com/OpenDiablo2/OpenDiablo2/main.go:44 +0x2d9
exit status 2

log.txt

Desktop (please complete the following information):

  • OS: Arch Linux

Additional context
Contents of config.json:

{
    "Language": "ENG",
    "FullScreen": false,
    "Scale": 1,
    "TicksPerSecond": -1,
    "RunInBackground": true,
    "VsyncEnabled": true,
    "SfxVolume": 1.0,
    "BgmVolume": 0.3,
    "MpqPath": "/home/gilgamesh/workspace/gamu",
    "MpqLoadOrder": [
        "Patch_D2.mpq",
        "d2exp.mpq",
        "d2xmusic.mpq",
        "d2xtalk.mpq",
        "d2xvideo.mpq",
        "d2data.mpq",
        "d2char.mpq",
        "d2music.mpq",
        "d2sfx.mpq",
        "d2video.mpq",
        "d2speech.mpq"
    ]    
}

Full-Screen Toggle Issue

There is code commented out in SDL2Renderer that allows you to toggle in and out of full screen mode. For some reason, when you toggle, it messes up things like textures, and possibly offsets. Figure out how to fix this, and then re-enabled the toggle logic.

Interface Comments

Although code comments aren't absolutely necessary in most of the code, the interfaces in OpenDiablo2.Common/Interfaces absolutely needs to be thoroughly commented as these are the visible things other parts of the system access. The names, properties, and functions all need comments.

Load Performance (Need profiler info)

On my machine (tm) the game boots to the main menu in about 1.5 seconds, but for some people we've seen between 10 seconds to a full minute to load. I need profiler outputs attached so I can trace this speed issue down. It's hard for me to fix as I do not have this issue.

UI Logic needs re-factoring

I will be completely re-doing the UI logic very soon. The current implementation is messy and unmanageable. Do not write any logic against the UI subsystem until this task is done.

Map IDs

We need to examine data\global\excel\LvlPrest.txt and pull out all of the distinct names and LevelId values and put them into the eLevelId struct (in eLevelId.cs).

To be clear, for the following rows:
Act 1 - Wild Border 7 10 0 0
Act 1 - Wild Border 8 11 0 0
Act 1 - Town 1 Transition S 3 0 1

You always take the SECOND number, thus the new entries would be:
Act1_Wild_Border_7 = 10,
Act1_Wild_Border_8 = 11,
Town 1 Transition S wouldn't be valid as it doesn't have a value for the level id. Only records with LevelId need to be added.

Map cache needs to expire

The cell data for maps need to expire after some time after not being accessed. Now that we are generating more and more map data, we will have a lot of areas locked into memory that we are nowhere near. This works into the GetMapCellInfo logic somehow.

Hero select idle animation speed

Describe the bug
The idle animations for the heros on the hero select screen is too fast.

To Reproduce
Steps to reproduce the behavior:

  1. Go to The hero select screen

Expected behavior
The hero's idle animations should be the same speed as in the original game.

Checkbox UI element

Is your feature request related to a problem? Please describe.
We need the checkbox UI element implemented as it is needed in the hero select screen.

Diablo2.Common

The Diablo2.Common should be the only project the other projects reference, aside from the core Diablo2 project, which references everything (so that the DLLs all build to the same folder). Any project that references anything besides Diablo2.Common needs to be refactored using Dependency Injection. We should expose an interface in the Interfaces folder, implement it for the specific class, and wire up an autofac rule so that it can be instantiated. If you need to pass parameters in, look at out Button gets injected with parameters (Button also needs an IButton).

Once we are able to set up the references properly, it should be relatively easy to keep on top of the design as the code grows.

Map Generation

We need to start thinking about map generation. There are many aspects to it, and there are two map types of generated maps: Wilderness, and Mazes. Right now our rendering engine supports endless maps, and we are now at a point where we can get serious about generating this stuff.

Item palettes

Is your feature request related to a problem? Please describe.
In PaletteDefs.go, it only lists palettes from global/palette. But if you look in /data/global/items/Palette, there are additional .dat files.

Currently in Palette.go, the LoadPalettes() function only scans for /data/global/palette/ for each mpq file (called from engine). This needs to be re-tooled to not only scan for that, but also for any additional palette files for items. Additionally, the palette definitions need to be added to PaletteDefs.go.

error when first running OpenDiablo2: File '/data/global/sfx/cursor/button.wav' not found during preload of listfiles, and could not be located in any MPQ checking manually.

Describe the bug
OpenDiablo2 fails to locate the /data/global/sfx/cursor/button.wav sound effects resource when run on Linux. The resource is however present in the d2sfx.mpq archive.

To Reproduce
Steps to reproduce the behavior:

  1. At rev c846984 of OpenDiablo2.
  2. Use config as listed below.
  3. Run the OpenDiablo2 game on Linux.
  4. Notice error mentioning /data/global/sfx/cursor/button.wav as reported to terminal.
$ OpenDiablo2
2019/11/05 22:52:22.877441 /home/u/Desktop/OpenDiablo2/main.go:27: OpenDiablo2 - Open source Diablo 2 engine
2019/11/05 22:52:22.882323 /home/u/Desktop/OpenDiablo2/Core/Engine.go:89: Loading configuration file
2019/11/05 22:52:22.882466 /home/u/Desktop/OpenDiablo2/Core/Engine.go:117: mapping mpq file structure
2019/11/05 22:52:23.424733 /home/u/Desktop/OpenDiablo2/Common/Palette.go:48: Loaded 18 palettes
2019/11/05 22:52:23.497935 /home/u/Desktop/OpenDiablo2/Common/TextDictionary.go:35: Loaded 9094 entries from the string table
2019/11/05 22:52:23.502664 /home/u/Desktop/OpenDiablo2/Common/LevelTypes.go:50: Loaded 38 LevelType records
2019/11/05 22:52:23.512479 /home/u/Desktop/OpenDiablo2/Common/LevelPresets.go:88: Loaded 1091 level presets
2019/11/05 22:52:23.537079 /home/u/Desktop/OpenDiablo2/Common/LevelWarp.go:48: Loaded 83 level warps
2019/11/05 22:52:23.560858 /home/u/Desktop/OpenDiablo2/Common/ObjectTypes.go:30: Loaded 573 object types
2019/11/05 22:52:23.569161 /home/u/Desktop/OpenDiablo2/Common/Objects.go:352: Loaded 571 objects
2019/11/05 22:52:23.579404 /home/u/Desktop/OpenDiablo2/Common/Weapons.go:281: Loaded 307 weapons
2019/11/05 22:52:23.590434 /home/u/Desktop/OpenDiablo2/Common/Missiles.go:304: Loaded 684 missiles
2019/11/05 22:52:23.611917 /home/u/Desktop/OpenDiablo2/Common/Sounds.go:97: Loaded 4699 sound definitions
2019/11/05 22:52:23.683136 /home/u/Desktop/OpenDiablo2/Core/Engine.go:207: File '/data/global/sfx/cursor/button.wav' not found during preload of listfiles, and could not be located in any MPQ checking manually.

Expected behavior
OpenDiablo2 would successfully locate the button.wav sound effect of d2sfx.mpq.

Desktop (please complete the following information):

  • Arch Linux

Additional information:

Contents of config.json:

{
    "Language": "ENG",
    "FullScreen": true,
    "Scale": 1,
    "TicksPerSecond": -1,
    "RunInBackground": true,
    "VsyncEnabled": true,
    "SfxVolume": 1.0,
    "BgmVolume": 0.3,
    "MpqPath": "/home/u/_share_/diablo_ii/",
    "MpqLoadOrder": [
        "Patch_D2.mpq",
        "d2exp.mpq",
        "d2xmusic.mpq",
        "d2xtalk.mpq",
        "d2xvideo.mpq",
        "d2data.mpq",
        "d2char.mpq",
        "d2music.mpq",
        "d2sfx.mpq",
        "d2video.mpq",
        "d2speech.mpq"
    ]
}
$ ls /home/u/_share_/diablo_ii/
  d2char.mpq    d2music.mpq     d2video.mpq     d2xvideo.mpq
  d2data.mpq    d2sfx.mpq       d2xmusic.mpq    Patch_D2.mpq
  d2exp.mpq     d2speech.mpq    d2xtalk.mpq  

The button.wav file is present in d2sfx.mpq, as seen below:

mpqeditor

Need map screenshots for randomly generated areas

We need people to run around areas and screenshot a completed map (only randomly generated areas, NOT mazes like caves, we're not there yet). I don't need 100s of them, but enough to understand how the maps are generated. You can screenshot and ctrl+v into the reply box to attach an image. An example is attached below.

image

Hero Screen text input

Describe the bug
The SDL implementation remembers all keys pressed before going to the hero screen. When you get there, it puts in all the characters you typed.

To Reproduce
Steps to reproduce the behavior:

  1. Start the game
  2. Press some character keys on the keyboard
  3. Go to the hero screen
  4. See the text automatically get placed in

Expected behavior
The name input shouldn't read keys that were typed before going to this screen.

Desktop (please complete the following information):

  • OS: Windows
  • Version v0.01

Additional context
This is most likely SDL buffering the text. We either need to drain it, or execute a command to clear it out when we switch to this screen.

Object and NPC placement issues

The NPCs and objects on the map are in obviously incorrect locations. I am not quite sure if this is one issue, or multiple issues combined causing this. I have verified with DS1Edit that both objects and NPCs are mis-positioned, but in different amounts and in different ways, leading me to believe there is some sort of offset relative to each entity that is not being taken into account.

macOS support

Hi! Thanks for starting this amazing project.

Here's my assessment on trying to run it on macOS:

  1. System.Collections.Immutable is not recognized during compilation, so I replaced all references with the System.Collections.Generic equivalents and it compiles, so I can now run it.

  2. After that, it shows a blank screen and crashes with "Decryption failed" for D2xMusic.mpq, so I disabled all code related to music, so now it shows the main screen (although with some graphical glitches).

  3. After that, I try starting singleplayer, it shows the loading screen (non-animated), but it crashes with "Decryption failed" for d2exp.mpq. (I can: look into the credits, after seeing a non-animated loading screen, open GitHub page, exit game)

Any help I can get with fixing "Decryption failed"? I doubt I can figure this out on my own. With other bugs or missing features, I might be able to help :)

Extra info

Here are some screens of it running on macOS: https://imgur.com/a/xz8bonF

I'm using Visual Studio for macOS with Mono.

I tried running with:

  • Diablo 2 macOS 1.14d LOD,
  • Diablo 2 Windows 1.14d LOD,
  • Diablo 2 Windows 1.13c LOD

All to similar results.

Audio backend re-write

The existing audio code nukes ram randomly causing very 'fun' crashes. The code has been commented out until we can re-write it using standard SDL audio and software mixing.
I'm also open to using a completely different audio back-end as long as it is portable.

Document the file formats

We need to expand the wiki and document all of the file formats. The information is slowl dying online and we need a fresh place to store it so anyone coming after us can see how all of this stuff works under the hood.

panic: opengl: width (16384) must be less than or equal to 8192

Running the latest version of OpenDiablo2 at c51e464 foo, the following errors is encountered during the first loading screen.

Note, the issue is not present in rev a105bb3, so the commit that introduced the issue is 7859b69.

u@x220 ~/D/OpenDiablo2> OpenDiablo2
2019/11/09 18:14:02.009272 /home/u/Desktop/OpenDiablo2/main.go:32: OpenDiablo2 - Open source Diablo 2 engine
2019/11/09 18:14:02.014032 /home/u/Desktop/OpenDiablo2/core/Engine.go:78: Loading configuration file
2019/11/09 18:14:02.083504 /home/u/Desktop/OpenDiablo2/common/Palette.go:47: Loaded 18 palettes
2019/11/09 18:14:02.114719 /home/u/Desktop/OpenDiablo2/common/TextDictionary.go:35: Loaded 9094 entries from the string table
2019/11/09 18:14:02.115934 /home/u/Desktop/OpenDiablo2/common/LevelTypes.go:50: Loaded 38 LevelType records
2019/11/09 18:14:02.122797 /home/u/Desktop/OpenDiablo2/common/LevelPresets.go:88: Loaded 1091 level presets
2019/11/09 18:14:02.124343 /home/u/Desktop/OpenDiablo2/common/LevelWarp.go:48: Loaded 83 level warps
2019/11/09 18:14:02.127621 /home/u/Desktop/OpenDiablo2/common/ObjectTypes.go:30: Loaded 573 object types
2019/11/09 18:14:02.142292 /home/u/Desktop/OpenDiablo2/common/Objects.go:352: Loaded 571 objects
2019/11/09 18:14:02.149965 /home/u/Desktop/OpenDiablo2/common/Weapons.go:284: Loaded 307 weapons
2019/11/09 18:14:02.153579 /home/u/Desktop/OpenDiablo2/common/Armor.go:277: Loaded 203 armors
2019/11/09 18:14:02.157234 /home/u/Desktop/OpenDiablo2/common/UniqueItems.go:132: Loaded 352 unique items
2019/11/09 18:14:02.177851 /home/u/Desktop/OpenDiablo2/common/Missiles.go:304: Loaded 684 missiles
2019/11/09 18:14:02.199542 /home/u/Desktop/OpenDiablo2/common/Sounds.go:102: Loaded 4699 sound definitions
2019/11/09 18:14:02.212278 /home/u/Desktop/OpenDiablo2/common/ObjectLookup.go:92: Loaded 7892 object lookups
2019/11/09 18:14:02.227565 /home/u/Desktop/OpenDiablo2/common/AnimationData.go:47: Loaded 3529 animation data records
panic: opengl: width (16384) must be less than or equal to 8192

goroutine 23 [running]:
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.(*Driver).checkSize(0xba83e0, 0x4000, 0x20)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/graphicsdriver/opengl/driver.go:62 +0x201
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.(*Driver).NewImage(0xba83e0, 0x2300, 0x1e, 0x1, 0x0, 0x0, 0x0)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/graphicsdriver/opengl/driver.go:77 +0xaa
github.com/hajimehoshi/ebiten/internal/graphicscommand.(*newImageCommand).Exec(0xc0010ee100, 0x156, 0x0, 0x0)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/graphicscommand/command.go:563 +0x50
github.com/hajimehoshi/ebiten/internal/graphicscommand.(*commandQueue).Flush(0xba81c0)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/graphicscommand/command.go:272 +0x780
github.com/hajimehoshi/ebiten/internal/graphicscommand.FlushCommands(...)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/graphicscommand/command.go:305
github.com/hajimehoshi/ebiten/internal/restorable.ResolveStaleImages()
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/restorable/images.go:55 +0x2d
github.com/hajimehoshi/ebiten/internal/shareable.EndFrame(0xc000339980, 0xc001112040)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/shareable/image.go:562 +0x3b
github.com/hajimehoshi/ebiten/internal/buffered.EndFrame(...)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/buffered/image.go:43
github.com/hajimehoshi/ebiten.(*uiContext).Update(0xc000339880, 0xc002423d00, 0x0, 0x0)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/uicontext.go:130 +0x307
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).update(0xb6c540, 0x943fa0, 0xc000339880, 0x0, 0x0)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:793 +0x1d6
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).loop(0xb6c540, 0x943fa0, 0xc000339880, 0x0, 0x0)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:821 +0x8a
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).run(0xb6c540, 0x320, 0x258, 0x3ff0000000000000, 0xc00082c020, 0x1a, 0x943fa0, 0xc000339880, 0x40000, 0x40000)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:693 +0x165
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run.func1(0xc000012220, 0xc0000a4420, 0xb6c540, 0x320, 0x258, 0x3ff0000000000000, 0xc00082c020, 0x1a, 0x943fa0, 0xc000339880)
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:573 +0xdf
created by github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run
	/home/u/goget/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:570 +0x1c8

Select Hero Class screen

Implement the "Select Hero Class" screen, ensuring that all animations and UI input works as close to the original as possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.