mikemcmahon / seed Goto Github PK
View Code? Open in Web Editor NEWProject Seed - written in C++ with directx
Project Seed - written in C++ with directx
Dev Environment Setup -------------------------- 1) Install DirectX10 SDK (latest should be okay though, but this project was designed around 10) a) Define an environment variable called DXSDK_DIR that points to your DirectX10 SDK Installation 2) Configure the the project property pages (in visual studio) a) Configuration Properties b) C/C++ - Additional Include Directories * $(DXSDK_DIR)\include * ..\include c) Linker - Additional library directories * $(DXSDK_DIR)\lib\x86 * ..\lib d) Link - Input * d3d10.lib * d3dx10.lib * XInput.lib * Zdll.lib * $(AdditionalDependencies) # This step not currently needed, removed dependency on XmlHelper until we have more of the engine completed 3) Checkout the XmlHelper project as well, this is required for the XML File reading in the project (Seed currently relies on the build of this project)
Should be able to fade a scene out to a color (probably black since that's a common effect).
Take all of the visible sprites, over a given duration (in seconds) fade them all to the color black (colormodulate = 0, 0, 0, 1)
This should create the effect of a black fade out.
Create an enum for defining sprite positions relative to the world
positions
Need to handle sprite scrolling.
This means translating every objects position in the world.
We need to be able to create groups of sprites, grouping them together in some fashion. For example a boss could be a combination of sprites joined together.
Or a map layout could be the combination of many sprites to create the environment, each with their own set of rules/information.
Sprites need to keep track of not only their size, but their "actual" size, aka the contents within them.
The easiest course of action will probably be to just manually assign a sprite size (height / width) and a sprite hitbox size with xy coordinates that are relative to the sprite.
For example, given SpriteA with the following information
Size: 64x64
Location: 0,0
We know that the SpriteA contains an image of a ball that is only 32x32 pixels. In the current frame the ball is located at the very bottom of the sprite image and centered.
Hitbox size: 32,32
Location (Top Left), 12 ((sprite size - sprite hitbox width) / 16), 32.
We will need to calculate these sprite hit boxes for each and every sprite that it matters. (looking like sprite drawing software that understands this will be very important to have or create).
Sprites us a very basic way of determining when to animate, it works well at high frame rates but completely falls apart at lower frame rates.
Should the sprite maybe keep track of it's own QueryPerformanceCounter, or maybe GetTickCount()?
Not sure, but I need the sprite to always run in the given duration regardless of the frame rate. Which it currently sort of does and does not.
We need to keep the animations synced, so if i am running up and am currently on frame 7 of a 10 frame run animation and I press to turn up and to the right or all the way to the right it should jump me to frame 7/8 of the animation for those directions.
This should (i would imagine) prevent jittery ness when changing directions. as long as each direction contained the same number of frames that were all synced to the correct pose just at different angles.
Not going to work out, pull out the function pointers, they're hurting us more than they're helping us!
We need a DI like way of sprite creation, relying on code generated sprites is annoying.
Create an xml structure to define sprite creation. The files can be ingested and then used to generate all of the sprites for the game at once, only creating the texture resources when needed.
<sprites>
<sprite name="MyMainCharacter" type="character/npc/background" >
<textureMaps>
<textureMap name="sheet1"
resource="/path/to/texture/map.png"
height="512"
width="512"
cellSize="32" />
<textureMap name="sheet2"
resource="/path/to/texture/map.png"
height="64"
width="512"
cellSize="32" />
</textureMaps>
<!-- for characters / NPC we will identify their animations in almost the same exact way
but NPCs will have an additional field for setting default walk paths -->
<path startDirection="Up">
<pattern>UULL</pattern>
<path>
<animations>
<animation name="walkingLeft" map="sheet1" duration="in-milliseconds" frames="4">
<cellPosition x="3" y="2" />
</animation>
</animations>
<!-- for backgrounds / tile sets we'll just map out where to find stuff in the tile set -->
<tiles map="sheet2">
<tile>
<span x="1" y="1" />
<cellPosition x="2" y="2" />
</tile>
</tiles>
</sprites>
We should handle our zorder by looking at the bottom edge of a sprite.
The bottom of edge of a sprite will determine if a sprite is closer to us or further away. For example:
MainCharacter1 is at XY position 30,30
NPC is at XY position: 30,24.
We would display MainCharacter1 on top of NPC1 because NPC is closer to the top of the screen, therefore (based on the camera) would be behind the sprite at Y position 30.
We need to ensure that certain sprites only animate while moving. For example if I am running to the left or right, i should show the left or right animations and stop animating when I stop (and possibly jump back to the first frame of the animation)
We need a way to key events based on time. I think our game engine needs to keep track of time and cache it at the start of each render/frame.
Like
GameEngine::GetTime()
That will return the time in Milis as well as update a static LONGLONG that points to the current time.
Then I can lets say on game go, hey has 5 seconds elapsed since the last time i checked (keeping track of my own internal time from the last time a frame was rendered)
If so then do something !
So GameEngine::GetTime(bool) (currently have Time::GetTime() will be easy enough to stuff that into the game). The bool will true update cache, or false just returns what's been cached .
Then in GameLogic::EventTriggers
we can do something like
if (GameEngine::GetTime(false) - GameLogic::EventTrigger::Time() > 5000 )
// Do something because 5 seconds has passed since our triggers time
We also need a way to keep track of event triggers like this, they can be character specific - like if you stand idle for too long. Dungeon specific (after 10 minutes of being in a dungeon all monsters become stronger, but i doubt we'll do that, just an example). Auto pause if no input is detected...etc
Then there are EventTriggers that happen because of other things in the game, but I'm not too worried about those at the moment. that's more on the game logic side of things.
We need to take the rendering and engine logic out of the main game and stuff it into its own library. Why? Because it's too messy and makes the project too big to have it all in the same place. It also makes it harder to use in the future!
We really need some dummy sprite sheets with the following
1 map that is bigger than the game window
1 map that is smaller than the game window
1 main character
1 NPC
1 tile set with basic tiles.
Right now we only handle XBox360 Controller input, we should do the following:
Handle Keyboard / Mouse input
Handle Gamepad input (other than xbox360)
Create one wrapper class that encapsulates all three/four input methods with external methods like
didMoveLeft
didMoveRight
didInteract
So the user can just specify the input method, but the manner in which control is handled is very generic.
Performance handling of the keyboard / mouse / joypads can be done with the following API(s):
DirectInput
CreateDevice
This could possibly be engine logic, or game logic. But we need to layer-ize our sprite display with the obvious layers
Background
NPCs / Main-Character
Foreground
We need to have the following functionality:
Show Fonts
Show Dialog Box
Show Sprite
Show Animated Sprite
Move Sprites
Animate on Move
Colorized Sprite
Gradients
A game engine that cannot play sound is no game engine of mine. We should start looking into what kinds of libraries are available for this, what formats to support, what features to have...etc
Create a method to rotate sprites over a period of time
if the period of time specified is 0 then rotate instantly
rotation is in degrees (need to convert from radians) .
Rotation should happen smoothly over a given period.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.