Added backdrop property and backdrop loading to maps. Release build 5549.

pull/29/head
sigonasr2 1 year ago
parent 3f4c714c42
commit ece13c0b28
  1. 17
      Adventures in Lestoria/Adventures in Lestoria.tiled-project
  2. 1
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  3. 3
      Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
  4. 32
      Adventures in Lestoria/AdventuresInLestoria.cpp
  5. 2
      Adventures in Lestoria/AdventuresInLestoria.h
  6. 8
      Adventures in Lestoria/DEFINES.h
  7. 3
      Adventures in Lestoria/Map.cpp
  8. 6
      Adventures in Lestoria/TMXParser.h
  9. 7
      Adventures in Lestoria/TODO.txt
  10. 2
      Adventures in Lestoria/Version.h
  11. BIN
      Adventures in Lestoria/assets/Campaigns/1_1_v2.png
  12. 1
      Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx
  13. 1
      Adventures in Lestoria/assets/Campaigns/1_2.tmx
  14. 1
      Adventures in Lestoria/assets/Campaigns/1_3.tmx
  15. 1
      Adventures in Lestoria/assets/Campaigns/1_4.tmx
  16. 1
      Adventures in Lestoria/assets/Campaigns/1_5.tmx
  17. 1
      Adventures in Lestoria/assets/Campaigns/1_6.tmx
  18. 1
      Adventures in Lestoria/assets/Campaigns/1_7.tmx
  19. 1
      Adventures in Lestoria/assets/Campaigns/1_8.tmx
  20. 1
      Adventures in Lestoria/assets/Campaigns/Boss_1_v2.tmx
  21. BIN
      Adventures in Lestoria/assets/backgrounds/forest_backdrop.png
  22. 6
      Adventures in Lestoria/assets/config/configuration.txt
  23. 10
      Adventures in Lestoria/assets/config/gfx/backdrops.txt
  24. BIN
      Adventures in Lestoria/assets/glomzy-05-1x.png
  25. 4
      Adventures in Lestoria/pixelGameEngine.cpp
  26. BIN
      x64/Release/Adventures in Lestoria.exe

@ -33,6 +33,17 @@
"wangset"
]
},
{
"id": 30,
"name": "Backdrop",
"storageType": "string",
"type": "enum",
"values": [
"None",
"forest"
],
"valuesAsFlags": false
},
{
"id": 27,
"name": "BGM",
@ -213,6 +224,12 @@
"drawFill": true,
"id": 19,
"members": [
{
"name": "Backdrop",
"propertyType": "Backdrop",
"type": "string",
"value": "None"
},
{
"name": "Background Music",
"propertyType": "BGM",

@ -679,6 +679,7 @@
<Text Include="assets\config\classes\Witch.txt" />
<Text Include="assets\config\classes\Wizard.txt" />
<Text Include="assets\config\configuration.txt" />
<Text Include="assets\config\gfx\backdrops.txt" />
<Text Include="assets\config\gfx\gfx.txt" />
<Text Include="assets\config\gfx\themes.txt" />
<Text Include="assets\config\items\Accessories.txt" />

@ -843,6 +843,9 @@
<Text Include="assets\config\audio\events.txt">
<Filter>Configurations\Audio</Filter>
</Text>
<Text Include="assets\config\gfx\backdrops.txt">
<Filter>Configurations\GFX</Filter>
</Text>
</ItemGroup>
<ItemGroup>
<Image Include="assets\heart.ico">

@ -76,6 +76,7 @@ All rights reserved.
INCLUDE_EMITTER_LIST
INCLUDE_ITEM_CATEGORIES
INCLUDE_BACKDROP_DATA
bool _DEBUG_MAP_LOAD_INFO = false;
//360x240
@ -137,6 +138,9 @@ AiL::AiL()
std::string ITEM_STATS_CONFIG = CONFIG_PATH + "item_stats_config"_S;
utils::datafile::Read(DATA,ITEM_STATS_CONFIG);
std::string BACKDROP_CONFIG = CONFIG_PATH + "backdrop_config"_S;
utils::datafile::Read(DATA,BACKDROP_CONFIG);
auto keys=DATA.GetProperty("ItemConfiguration");
for(auto&[key,value]:keys){
std::string config=DATA["ItemConfiguration"][key].GetString();
@ -835,7 +839,11 @@ void AiL::RenderWorld(float fElapsedTime){
}
#pragma region Basic Tile Layer Rendering
FillRectDecal({0,0},GetScreenSize(),{100,180,100});
if(GetCurrentMap().backdrop.length()>0){
view.DrawPartialDecal({0,0},WINDOW_SIZE,BACKDROP_DATA[GetCurrentMap().backdrop].Decal(),"Backdrop Config.Speed Ratio"_F*-camera.GetPosition(),WINDOW_SIZE);
}else{
FillRectDecal({0,0},GetScreenSize(),{100,180,100});
}
for(RenderMode mode=RenderMode::REFLECTIVE_TILES;mode<=RenderMode::EMPTY_TILES;mode=RenderMode(int(mode)+1)){
if(mode==RenderMode::NORMAL_TILES){
SetDecalMode(DecalMode::ADDITIVE);
@ -929,12 +937,24 @@ void AiL::RenderWorld(float fElapsedTime){
}break;
case RenderMode::EMPTY_TILES:{
if(visibleTiles.count({x,y})){
view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100});
#pragma region Render Backdrop
if(GetCurrentMap().backdrop.length()>0){
vf2d tileWorldPos=vi2d{x,y}*GetCurrentMapData().tilewidth;
view.DrawPartialDecal(tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},BACKDROP_DATA[GetCurrentMap().backdrop].Decal(),"Backdrop Config.Speed Ratio"_F*-camera.GetPosition()+tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)});
}else{
view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100});
}
#pragma endregion
}
}break;
}
}else{
view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100});
if(GetCurrentMap().backdrop.length()>0){
vf2d tileWorldPos=vi2d{x,y}*GetCurrentMapData().tilewidth;
view.DrawPartialDecal(tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},BACKDROP_DATA[GetCurrentMap().backdrop].Decal(),"Backdrop Config.Speed Ratio"_F*-camera.GetPosition()+tileWorldPos,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)});
}else{
view.FillRectDecal(vi2d{x,y}*GetCurrentMapData().tilewidth,{float(GetCurrentMapData().tilewidth),float(GetCurrentMapData().tilewidth)},{100,180,100});
}
}
}
}
@ -2171,6 +2191,7 @@ bool AiL::OnUserDestroy(){
for(auto&[key,value]:MonsterData::imgs){
delete value;
}
BACKDROP_DATA.clear();
return true;
}
@ -2179,6 +2200,11 @@ void AiL::InitializeLevels(){
InitializeLevel("map_path"_S+operator""_S(("Levels."+key).c_str(),("Levels."+key).size()),key);
}
for(auto&[key,size]:DATA["Backdrops"]){
Renderable&backdrop=BACKDROP_DATA[key];
backdrop.Load("backdrop_directory"_S+DATA["Backdrops"][key].GetString(),nullptr,false,false);
}
Test::RunMapTests();
}

@ -54,6 +54,7 @@ All rights reserved.
#include "discord.h"
#endif
#include "Audio.h"
#include "olcPGEX_SplashScreen.h"
class AiL : public olc::PixelGameEngine
{
@ -63,6 +64,7 @@ class AiL : public olc::PixelGameEngine
friend class sig::Animation;
friend class Audio;
std::unique_ptr<Player>player;
SplashScreen splash;
public:
Pathfinding pathfinder;
static InputGroup KEY_CONFIRM;

@ -36,6 +36,11 @@ All rights reserved.
*/
#pragma endregion
#pragma once
#include <string>
using BackdropName=std::string;
#define INCLUDE_ANIMATION_DATA extern safemap<std::string,Animate2D::FrameSequence>ANIMATION_DATA;
#define INCLUDE_MONSTER_LIST extern std::vector<Monster>MONSTER_LIST;
#define INCLUDE_SPAWNER_LIST extern std::vector<MonsterSpawner>SPAWNER_LIST;
@ -53,6 +58,9 @@ All rights reserved.
#define DO_NOTHING [](MenuFuncData data){return true;}
#define INCLUDE_WINDOW_SIZE extern vi2d WINDOW_SIZE;
#define INCLUDE_BACKDROP_DATA extern std::map<BackdropName,Renderable>BACKDROP_DATA;
#define INCLUDE_CENTERED extern const vf2d Menu::CENTERED;
#define ACCESS_PLAYER Player*p=game->GetPlayer();

@ -41,8 +41,11 @@ All rights reserved.
INCLUDE_game
using BackdropName=std::string;
float TileGroup::FADE_TIME=0.3f;
uint8_t TileGroup::FADE_AMT=160;
std::map<BackdropName,Renderable>BACKDROP_DATA;
Map&MapHelper::MapFromString(std::string mapName){
return game->MAP_DATA.at(mapName);

@ -101,6 +101,7 @@ struct Map{
std::vector<EnvironmentalAudio>environmentalAudioData;
std::string mapType="";
std::string bgmSongName="";
BackdropName backdrop="";
std::set<std::string>spawns;
std::map<int,SpawnerTag> SpawnerData; //Spawn groups have IDs, mobs associate which spawner they are tied to via this ID.
std::map<std::string,std::vector<::ZoneData>> ZoneData;
@ -365,6 +366,11 @@ class TMXParser{
parsedMapInfo.bgmSongName=newTag.data["value"];
}
} else
if (newTag.tag=="property"&&newTag.data["name"]=="Backdrop") {
if(newTag.data["value"]!="None"){ //None is a default value that we ignore.
parsedMapInfo.backdrop=newTag.data["value"];
}
} else
if (newTag.tag=="object"&&newTag.data["type"]=="AudioEnvironmentalSound") {
parsedMapInfo.environmentalAudioData.emplace_back();
prevAudioData=&parsedMapInfo.environmentalAudioData.back();

@ -1,11 +1,6 @@
January 1st
===========
The Hub / NPC Interactions
Audio Engine
- Audio Ambience Zones
- Menu Sound Effects
- Attack / Enemy Sound Effects
- Music Loading/Looping
Settings Menu
- Any settings should be saved to the save file!
- Volume Controls
@ -18,8 +13,6 @@ Settings Menu
-Click on title screen should not process as input immediately.
-Investigate why frame rate matters for intro screen.
-Warrior slash should occur even with no target
-Add in other story plates
-Faster main menu screen transition
-Simplify map collision tiles by removing the requirement for hidden boundaries.
-Loading should happen on fadeout.

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 1
#define VERSION_BUILD 5533
#define VERSION_BUILD 5549
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="205" height="205" tilewidth="24" tileheight="24" infinite="0" backgroundcolor="#475500" nextlayerid="10" nextobjectid="177">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
</properties>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="174" height="144" tilewidth="24" tileheight="24" infinite="0" nextlayerid="6" nextobjectid="108">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
</properties>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="240" height="120" tilewidth="24" tileheight="24" infinite="0" nextlayerid="7" nextobjectid="18">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
</properties>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="200" height="120" tilewidth="24" tileheight="24" infinite="0" nextlayerid="9" nextobjectid="23">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
</properties>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="200" height="250" tilewidth="24" tileheight="24" infinite="0" nextlayerid="7" nextobjectid="30">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
</properties>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="250" height="175" tilewidth="24" tileheight="24" infinite="0" nextlayerid="6" nextobjectid="31">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
</properties>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="225" height="150" tilewidth="24" tileheight="24" infinite="0" nextlayerid="7" nextobjectid="24">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
</properties>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="250" height="125" tilewidth="24" tileheight="24" infinite="0" nextlayerid="6" nextobjectid="26">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
</properties>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="64" height="80" tilewidth="24" tileheight="24" infinite="0" nextlayerid="5" nextobjectid="6">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty_boss"/>
<property name="Level Type" propertytype="LevelType" value="Boss"/>
</properties>

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

@ -59,6 +59,12 @@ item_img_directory = items/
# Path to story files
story_directory = config/story/
# Path to backdrop config file
backdrop_config = gfx/backdrops.txt
# Path to backdrop background files
backdrop_directory = assets/backgrounds/
# Path to sound effect files
sfx_directory = assets/sounds/

@ -0,0 +1,10 @@
Backdrops
{
forest = forest_backdrop.png
}
Backdrop Config
{
# Amount to move per pixel of actual world space.
Speed Ratio = 0.125
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

@ -50,4 +50,6 @@ All rights reserved.
#define TSX_PARSER_SETUP
#include "TSXParser.h"
#define OLC_PGEX_MINIAUDIO
#include "olcPGEX_MiniAudio.h"
#include "olcPGEX_MiniAudio.h"
#define OLC_PGEX_SPLASHSCREEN
#include "olcPGEX_SplashScreen.h"
Loading…
Cancel
Save