gosuKPop – Version 2.0!
gosuKpop has been updated
New features
- Brand new design and layout
- Responsive layout – The layout will change depending on how large your browser window or screen is. (There are still some bugs with mobile though)
- Registration/Membership system
- You can now create an account, which allows you to…
- Create and save playlists
- Upvoting/Downvoting system for videos (Similar to Reddit)
- Account management
- Playlist sharing, importing, and exporting
- Adding your own channels to the main video list
Also, the video list might not load for you due to the structure of sessions changing so… if there are any problems with loading the video lists, try clearing your cookies or registering and logging in (automatically will clear cookies).
Recently, I’ve been working on a quick web app called “gosukpop”. Basically it extracts music videos from certain Kpop YouTube channels and allows you to create a playlist. Currently it’s very very simple and only has the most basic features such as adding/removing videos to the playlist, playlist auto-play, and searching.
I’ll be adding some more features before I actually launch the app. Features such as:
- Sorting options – Allow users to sort the music video list by date, title, artist, etc.
- Playlist reordering
- Membership system to allow saving playlists, import/export playlists, and maybe Twitter and Facebook integration?
You can preview the app at http://gosukpop.com
I’ve decided to pause the development of my multiplayer tiled RPG for now. It’s gotten a bit too complex for me and I’d rather make a single player RPG before I move on to multiplayer.
The new game will either be a top-down or side scroller; I haven’t really decided yet. I’ll be sure to post all the updates on here.
What has been added/fixed
- Basic equipment system working. Only works with armor and left, right, up, down animations right now. Preview:
- Before equipment
- After equipment
- Started working on the combat system.
- Only working on ranged attacks at the moment due to not having any animations for melee attacks…
- More work on the equipment system; the animations are a bit out of sync.
- Finish up ranged attacks
- Start melee attacks
What has been added/fixed
- Server can now load tmx map data for server-sided collision detection.
- Can now handle multiple maps with players on different maps.
- Client uses XML files for UI windows. This will allow users to customize their UI’s. This still needs some work. At the moment, it can only load 1 type of control (Labels).
- UI windows can also be opened and closed using hot keys. The hot keys can’t be customized yet; I will add this in later. The server or client will have to store the user’s key map (Most likely server will).
- Added a chat “log”.
- Started working on an inventory/equipment system – Only the basic framework for it is completed.
- The client can load the item data through XML files. This is only temporary…I kind of forgot I was making a multiplayer game
. The server should load the item data and then send that data to the client whenever it needs it. - “Equipping” items works. (Only text-based right now, I don’t have the graphics yet)
- Players can now reconnect to the server without the server crashing.
What’s next?
I’m really not sure what’s next. Graphics are a very crucial part of this project, and I simply don’t have the skills to make decent looking graphics. So, I’m considering putting the programming to the side and learning either Blender or pixel art. Or I can just use really crappy programmer art and then update all the graphics later on. I’m really not sure yet.
If you have any questions on how I implemented something, feel free to ask!
I already have a basic UI system; these notes are more for opening and closing windows with hotkeys (a key map).
UserInterfaceSingleton class
Contains a static instance of UserInterfaceSingleton
Dictionary<string, Window> windowsCache – Store all loaded UI windows
GetWindow(string name) function
- All UI data is stored in XML files; this will allow users to create custom UI’s.
- Example XML file:
<window> <name>Inventory</name> <position x="200" y="200"/> <backgroundSprite>inventory_window</backgroundSprite> <visible>true</visible> <enabled>true</enabled> <focused>true</focused> <controls> <label> <name>testlabel</name> <offset x="50" y=100/> <font>CharacterNameDisplay</font> <color>Black</font> <parent></parent> <text>test text</text> <visible>true</visible> <enabled>true</enabled> </label> </controls> </window>
Dictionary<Key, string> KeyMap – Stores all UI hotkeys (Todo: Stores ALL hotkeys to allow user defined key map)
Just random notes for my item/equipment system.
- Store all item data in XML data.
- I will have to write a custom content reader, writer, and processor to use the XNA Content Pipeline. Allows me to store the XML data as .XNB files instead of XML files (Can’t be opened and edited…easily).
- XML file will store the item’s id, name, path to sprite sheet, and stats.
Game client will load and store all items on start up. Hopefully this won’t be too slow.- Create a GameDataProvider class
to load and store the items and equipment.Decided to use a factory/singleton instead. Whenever data is needed for an item, I just have to pass in the id and the GameDataProvider will grab the data. - static Instance of GameDataProvider
- Dictionary (int, Item) Items – Used for cache (Items that have been loaded will be added here)
- Item Class
- int id
- string name
- byte type
- Texture2D sprite
- Vector2 position (Drawing position, will need a different variable for inventory position)
- Dictionary(int, Equipment) Equipment - Used for cache (equipment that has been loaded will be added here)
- Equipment Class
- int id
- string name
- byte type
- Dictionary(WeaponDirection, Animation) animations
- Vector2 position (drawing position)
- 2nd Option: Item and Equipment class are actually very similar, use a item base class and have a RegularItem and Equipment class that inherits from Item.
- Item Base class
- int id
- string name
- byte type
- Vector2 position
- RegularItem extends Item
- Texture2D sprite – Regular items shouldn’t need animations
- int quantity
- Equipment extends Item
- Dictionary(WeaponDirection, Animation) animations
- Variables for Weapon stats
I spent the last week trying to implement server-sided collision detection.
How it works
- Server loads the map’s TiledMap XML file (Contains map name, layers, tiles, etc).
- The map file contains a layer called collision.
- Every time the player moves it sends a packet/message to the server. (Packet contains the players character id, direction, position.
- The server “draws” a rectangle around the player based on the positions it receives.
- The server then loops through each tile in the collision layer and if the tile’s id is not equal to 0 then that tile is not passable.
- It checks if the player’s rectangle bounds is intersecting with the tile’s bounds, if it is then there is a detection.
It’s a pretty simple detection system, and needs some work. There are still a few bugs I need to work out. After I’m done fixing the bugs I’ll definitely need to optimize it…the client’s FPS drops from 60 to ~47.
Future Optimizations
- Only need to check for collisions for tiles that are around the player. (Currently it checks EVERY collision tile in the map)
- I might have to implement pixel collision detection for other objects such as items, monsters, etc.
What’s next?
- Handling players quitting/disconnecting
- Character creation
- Chat system – display some kind of chat log
I ran into a small problem while working on my game. I needed my server to load the .tmx files from Tiled Map Editor so I could do server-sided collision detection. I planned on using TiledLib for my server project, but TiledLib seemed to only work with XNA and not just plain C#. TiledLib’s map object needed me to load from XNA’s content pipeline. I have no idea how to allow my server project to use the content pipeline.
Since TiledLib didn’t work, I had to roll out my own parser. Luckily Tiled has a setting to export as XML and not encoded Base64.
Here’s my solution:
private void LoadMapFile(string fileName)
{
XmlDocument mapfile = new XmlDocument();
mapfile.Load("data/maps/" + fileName);
XmlNode mapNode = mapfile.GetElementsByTagName("map")[0];
width = int.Parse(mapNode.Attributes["width"].Value);
height = int.Parse(mapNode.Attributes["height"].Value);
tileWidth = int.Parse(mapNode.Attributes["tilewidth"].Value);
tileHeight = int.Parse(mapNode.Attributes["tileheight"].Value);
XmlNodeList layerNodes = mapfile.GetElementsByTagName("layer");
foreach (XmlNode layerNode in layerNodes)
{
TiledLayer tileLayer = new TiledLayer(layerNode.Attributes["name"].Value, int.Parse(layerNode.Attributes["width"].Value), int.Parse(layerNode.Attributes["height"].Value));
foreach (XmlNode dataNode in layerNode.ChildNodes)
{
int row = 0;
int col = 0;
foreach (XmlNode tileNode in dataNode.ChildNodes)
{
Tile newTile = new Tile(int.Parse(tileNode.Attributes["gid"].Value),row,col);
tileLayer.Data[row, col] = newTile;
if (col < tileLayer.Width - 1)
col++;
else
{
col = 0;
if (row < tileLayer.Height - 1)
row++;
}
}
}
layers.Add(tileLayer.Name, tileLayer);
tileLayer.Print();
}
}
This only parses the basic's of the Tiled map; map size, layers, tiles. I'll eventually add in properties.
For the past month I have been working on a multiplayer RPG game written in C# and XNA. It is a game that utilizes a tile map and multiplayer. Right now I’m just programming basic game functionality; I haven’t really made any game design decisions yet (story, characters, mechanics, etc). This project is more for me to learn how to code a tiled and multiplayer game. I won’t be worrying about designing the game until I am finished with all the basics.


