I know it's not very efficient, but I am creating a 2D MMORPG in C# WPF.
So far I've created a server and a login (with Database & sql and stuff).
Everything is great and I have a pretty good idea on how to make a chat, inventory system and all.
Right now, I'm stuck with maps and the scrolling system.
As you should know, 2D games usually are side-scrolling, means if you go left the screen goes with you. And that is a thing that I don't know how to do.
My "Map" is actually a picture of a tile and background around it, I don't have any idea on how to make a complex map with path, spawn points etc.
I'd be glad if someone could give me ideas or any thing the could help me in the process.
Another thing is the character animation - so far I'm using a picture as character, and it looks pretty lame. I mean, the character is beautiful, we are drawing the characters ourself, but I just don't know how to fuse them into the game with animations and such without being lame and just switching pictures. There must be an efficient way. I hope you could help me :\
(I'm using blend for animations like fade, but I don't think that Storyboards are serious enough for a character animation.)
P.S
I do know that WPF isn't suitable for 2d games, idk why tough, but I know it doesn't. And still I want to develop my game with it.
Thanks to the helpers <3
EDIT:
I moved to Unity, it's easy and simple, and uses C# so I like it. I already moved my client to there without any effort, LOVE IT :P
Thanks again to the helpers. wish me luck ;)
Related
Hi i want to make andriod/ios game. it will be simple RPG base click game like Shakes and fidget. I wonder what app will be best to do it. So farn i know javasript well and java on low level. I find gap mobile could be good, because of my knowlidge of javascript. But unity looks good too, problem is i never done nothing in C# or unity. What is your experience and opinions?.
I know my english is bad, so i apologize for that.
I'm using Unity 2D with C# and it's works really well for me. I suggest you to learn C# if you want to go with Unity(which I think is a really good option) but you can use javascript with Unity too if you don't want to learn C# but I don't know if this feature is still usable.
You can just search unity 2d tutorials at youtube if you want free tutorials (My advices are Brackeys and Blackthornprod) or you can use sone online learning websites like Udemy (which I used to learn unity and which helped me a lot)
I have been working on a project over the past 6 months creating a program to control some machinery. The software controls some servos, and other bits mostly via serial communication.
It is currently programmed in ANSI C99 in the Lab Windows IDE, along with some of its included libraries. As the project continues, there are many different variations on "how many" servos are needed for each build. This ends up requiring custom coding for each one. I feel the core logic could still be programmed this way, and just put into a dll if need be, and the rest programmed in something else like C++ if need be.
Due to the fact that each servo needs to be individually controllable, is there really a way to allow a user to select how many they want during an initial setup?
I know it is simple to create a UI element to allow a selection, but how would you go about dynamically creating new UI elements, and variables associated with that UI element for individual control? I think this could work in an interpreted language, where you could have a function literally write out new code after the user makes a selection, but I don't know how to achieve this in a compiled language.
I am currently just researching the feasibility of moving this direction at all, and would greatly appreciate any thoughts or input. If it is possible, I think I just need a basic example of how to go about this sort of problem.
The only way I can personally think of achieving this is to literally program out every possible scenario, but we are talking potentially about 50 variations, so I am really hoping there is a more efficient way to go about this.
If you have any questions for me in order to better answer, please feel free to ask! Thanks in advance!
I know the title is really unclear, so give me a moment :)
I'm a pro-coder doing cool stuff at work (console games), but I've got an idea for an app (for a couple of years now ;)) that I'd like to create at home.
With 15 years of experience, I don't want to fall in to the trap of wanting to do everything myself - I'd like to borrow or steal as much as I can for all the trivial stuff, so I can just focus on what I'd like to do.
But I DO want an app that works like people expect it to, with all bells and whistles people are used to.
Which means I need to create an app with (in my case) something like a workspace-interface,
and undo-redo system,
persistence (serialization / loading&saving),
and preferably a VisualStudio kind of dockable interface so users can decide what they want it to look like.
(On the other hand, it's not an editor - think more like Mac's Quartz Composer !)
I know all of these things and how to write them from scratch, I just don't want to bother - I want to spend my time on writing my own cool thingie, not writing an undo-system or a docking system or whatever.
So I'd like to piece together my application, stealing what I can steal,
focusing on what I want to create.
So far (not writing any code) I came to something like this :
use a very lightweight MVVM lib, probably just my own simple implementation since everything more is overkill.
Use AvalonDock for docking (http://avalondock.codeplex.com/ )
find an undo/redo action-based framework ( http://blogs.msdn.com/b/kirillosenkov/archive/2009/06/29/new-codeplex-project-a-simple-undo-redo-framework.aspx for example )
figure out a 'standard' serialization in C# / WPF or find a library ?
...
The main question in the end is :
if you're working on a hobby-project that needs to be semi-professional, but you just want to focus on the fun stuff...
What is your approach ?
Can you recommend a framework, can you tell me how you did this before ?
How did you avoid spending time on stuff that's in the end completely unrelated to what you'd actually want to do ?
With 15 yaers of experience, you probably know most of this already....but since you asked i'll mention it anyway. ;)
Part of being a professional (semi or not) is doing the boring, annoying parts and doing them well, with full conviction. That said, doing boring things on a hobby project can kill it. You'll lose interest and what once was a great idea is now an abandoned project on your disk.
When a library does not exactly provide what you want, professionally speaking you have two options:
The missing features are critical to have: in this case you have to write at least some of it yourself.
The missing features are not cricical: in this case use the library and accept any shortcomings it might have.
However since it's a hobby project you have to take one extra thing into account: what is the risk of you losing interest in the entire project if you choose option 1?
To decrease the risk i see some options:
You could begin with a simple implementation that takes little time, but will allow you to continue working on fun stuff. As your project takes shape and nears completion, you could be more motivated to improve "that last feature".
If possible, you could also release the app without the boring feature and let the users pressure you into making it. Getting instant gratitude for doing it might motivate you more.
As for doing unrelated stuff....if it's unrelated, then how did you end up doing it in the first place? Either it's fun and you're enjoying yourself, then i see no problem. Or it's not fun, and not relevant to the project. In that case just stop doing it.
I'd probably try to use existing frameworks as much as possible in order to maximize the amount of time spent on the "fun" stuff. That being the case, I'd say you'd want to use one of the existing light-weight mvvm frameworks such as:
Caliburn Micro
MVVM Light
Both of those frameworks are small and take a lot of the plumbing out of doing MVVM.
I would like to write some simple Mario-like game from scratch using language C. But honestly I have no idea how to do so, and I canĀ“t find any good tutorial for this, which is for free.
But to the actuall question, I have only written WinAPI programs so far, so all event handling and user input was handled by OS, with minimum work, But to develope game, with for example menus with non-rectangular buttons, animations, and so, I guess, there is no such thing in WinAPI taht could help me with this more than just some basic routines mouse pointer location and keypresses.
So, is the right way to write your game to write entire draw part of game engine by manipulating objects for player, enemies, and even background yourself, and than just use directdraw for output to screen?
EDIT:
I actually want to learn how to write games from scratch, becouse it must be great programming experience, and if you consider games like Commander Keen on DOS, created with no framework or libraries, but still so great.
A good approach to this would be to have a look at the SDL library. I'm not saying it's necessarily the best library for 2D games, but it's easy to get started with and the web is flooded with tutorials and open source code samples for simple homebrew 2D games written using SDL.
I do recommand the SDL too, but you should definitely have a look on lazyfoo tutorial, which is just great.
When I started programming I started doing it with Allegro, back in the good old DOS days. It was the first usable library which worked with SVGA libraries, and had a good sprite support. Then version3 came and they added support for windows (using GDI and Directy X, you could choose at runtime which engine to use). The linux port came to life, and all is good.
It's a very basic 2D library, and it will teach you the very basics of graphics and animations. Now it even contains audio support which is a very needed addition (well, I still remember V 2.9X...). They are in betas for version 5, and I think this is an interesting project for you to look into.
http://www.talula.demon.co.uk/allegro/
What are you guys talking about, the WinAPI has low level drawing routines.
Although using an established library like SDL is probably a better idea you could create your own abstractions to the WinAPI drawing routines without too much difficulty.
Then it's just a matter of creating the while loop that has all the drawing instructions and interpreting input. For 2D games this isn't too difficult.
I also used SDL, but try to look at HGE. It requires at least DirectX 8.0 so your applications will work only on Windows but on their forum you will find many topics on how to port it to OpenGL. In my opinion HGE will be easier to learn than SDL, because SDL is a low level library and you will have to learn how to handle many things by yourself. HGE is more ready to start just out of the box.
In short, yes - there's nothing in the WinAPI that will help you much. However, there are dozens of game engines that you could build your game on that would take a huge amount of gruntwork out of creating the game itself. A bit of Googling will help you.
(Personal recommendation: although it's technically a 3D engine, something like Unity is an excellent engine that includes tutorials for creating 2D games. Unity isn't C, but it does make your life a lot easier...)
EDIT: I actually want to learn how to write games from scratch, becouse it must be great programming experience, and if you consider games like Commander Keen on DOS, created with no framework or libraries, but still so great.
This is actually not quite right. Commander Keen (and any DOS games) do use libraries: the ones provided by DOS, BIOS, etc. Without libraries of one form or another, you wouldn't be able to do anything useful with C. For game programming, you really do want to leave all the low level details to someone else.
I'd recommend Allegro as a beginning game programming library.
Check out this one Game dev starting
They have realy a big resource related to game programming and a lot of beginner stuff. SDL is good, but you should consider about learning basic game techniques before start coding and even before start thinking about the api/libs you use.
Clear out how much "intelligence" you need (Ki), consider about loading/Saving a an early time, ... so much things that you should keep in mind if you want to finish your project.
Do you need a game editor? (Also..work) What about sound/graphics? Writing all this stuff on your own will take a lot of time (if you do not have experience). Creating the content is another big issue which can consume a lot of time, if you make it at all.
Maybe it will help you to have a look on some dev kids, because that will give you the idea how their engine works. Like this one (outdated) Dev kid
I've just started a similar project a few days ago, you can check it out over at GitHub.
It should give you some ideas about how the game is structured. As well as some details on a scrolling 2D map with collision (which turns out to be quite complicated if you want to get it 100% bug free). Oh, and it's using SDL as many here have already suggested.
As for me, this is my first C project. But I'll have to admit that I've done similar stuff in Java and Python before, so this was a good way for me to quickly learn C. And since it's learning and not any productive stuff, I'm using plain C99, which makes the task even "funnier".
But back to the game, you really need to think about your design before you start coding, write it down on a sheet of paper, or if you're like me and you don't have tree stuff in reach write it in pseudocode.
Think about as many possible game states as you can, nothing's worse than having to re-implement the whole player/map/whatever stuff from scratch just because you did not think about feature XYZ before.
Design is very important, if you don't have a goal to begin with, your project will reach a point where it fails, just like my Tuff did, well it also failed due to missing music and somebody who would have designed enemies, etc.
Speaking of graphics and such, bear in mind that the game will consist of much more than just the plain code. If you aren't good in graphics then take that into account while designing. Because you will quickly lose your motivation when the only things on the screen are colored rectangles.
Action Arcade Adventure Set (originally published as a book) is probably one of the most complete tutorials on how to write a 2D side-scrolling game. Although an older reference, many fundamentals for developing a 2D side-scroller have not changed.
Full source code examples and some tools to develop a side-scroller are provided as downloads. There is only one external library used to handle graphics primitives. As this is an older DOS program, you may have to use a DOS emulator like DOSBox or modify the examples for more modern environments.
I suggest you skim chapters 1 to 9 and focus on chapters 10 to 17.
I'm planning to write my first program (it'll be in C#), and I need help with a decision. I know I'll want to use custom controls in the final version of the program (probably these), but someone advised me to use standard WinForm controls until the program is running right. They said once things are running right, then I could replace the UI with the custom controls I want. Is this the best way for me to do it? Or should I use the custom UI controls from the beginning?
About me:
-Never written a program
-Have some light Access/VBA experience and classroom C++ Logic and non-UI programming
-If it matters, I don't know exactly how to do it yet but I do plan to try to keep the logic and the UI as separate as I possibly can. I know that needs to be a priority.
Thanks.
It depends on some factors:
The complexity: a simple custom-draw control can easily replace the standard winform control but generally custom controls add new features and tend to have differents methods and properties. In this case, switching to the custom control is not a simple task.
Your experience: Since you are pretty new to this, using a custom control can add another level of difficulty. Generally, these controls offers more options than the winform controls. So, it would be wise to start with the simple winform controls.
Since this is your first project, I tend to agree with your friend. While there is nothing inherently wrong with starting with third party controls, you will find that there is much more documentation and help available for the built in controls. In your early development efforts, you will likely hit many stumbling blocks, regardless of the choices that you make. Therefore, starting out with the most well-travelled course may make things easier for you starting out.
Once you have a little more experience debugging some of the issues that you will inevitably experience while learning a GUI framework, then it would make more sense to start bringing in glitzy third party controls.
Just use the standard controls. Keep it simple, Keep it simple, keep it simple. Also know that if you are still programming next year (hopefully on other projects), you will look back at this code in shame -- but that is a good thing.
Never written a program? I would not advise using any third party libs at this point, you are still learning. If you want the benefit of custom controls, why not write them yourself? You get the custom behavior and you actually learn how this stuff works.
Also, this statement is a bit of a red flag:
-If it matters, I don't know exactly how to do it yet but I do plan to try to keep the logic and the UI as separate as I possibly can. I know that needs to be a priority.
Design patterns are great, but until you get some experience it is hard to understand why they are so great. Start like everyone else writing 'bad' code and then come back to the design patterns. That way you will truly realize why they are so important (rather than just being told that they are). Don't try to grok the advanced stuff before being full competent with the fundamentals.