While Games are a hot topic, What's a good solution for the following problem:
I have core 'Engine' class, that manages 'Manager' instances, that are responsible for a single area like Sound, Physics and Graphics.
I'd like to allow another class in place of any of the default instances (which can be disabled).
Right now the Game specifies which of the default managers it would like to use, then can pass a pointer to a custom class that would be used in place of the engine's version. Is this a good solution? are there any alternatives?
[QUOTE=danharibo;28772059]While Games are a hot topic, What's a good solution for the following problem:
I have core 'Engine' class, that manages 'Manager' instances, that are responsible for a single area like Sound, Physics and Graphics.
I'd like to allow another class in place of any of the default instances (which can be disabled).
Right now the Game specifies which of the default managers it would like to use, then can pass a pointer to a custom class that would be used in place of the engine's version. Is this a good solution? are there any alternatives?[/QUOTE]
That is the easiest and most clear way I can think of doing it.
Plus that seems to be the standard for doing it (Box2D, Irrlicht, countless others do it)
I still didn't get to port hq4x, so I added this instead:
original:
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/seamless_original.png[/img]
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/seamless_original.png[/img]
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/seamless_original.png[/img]
hq3x:
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/seamless_wrong.png[/img]
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/seamless_wrong.png[/img]
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/seamless_wrong.png[/img]
seamless hq3x:
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/seamless_right.png[/img]
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/seamless_right.png[/img]
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/seamless_right.png[/img]
It basically just wraps the pointers around on the edges if seamless is true:
[code] int prevline, nextline;
var w = new uint[9];
for (int j = 0; j < Yres; j++)
{
if (j > 0)
{
prevline = -Xres;
}
else
{
if (seamless)
{
prevline = Xres * (Yres - 1);
}
else
{
prevline = 0;
}
}
if (j < Yres - 1)
{
nextline = Xres;
}
else
{
if (seamless)
{
nextline = -(Xres * (Yres - 1));
}
else
{
nextline = 0;
}
}
for (int i = 0; i < Xres; i++)
{
w[1] = *(sp + prevline);
w[4] = *sp;
w[7] = *(sp + nextline);
if (i > 0)
{
w[0] = *(sp + prevline - 1);
w[3] = *(sp - 1);
w[6] = *(sp + nextline - 1);
}
else
{
if (seamless)
{
w[0] = *(sp + prevline + Xres - 1);
w[3] = *(sp + Xres - 1);
w[6] = *(sp + nextline + Xres - 1);
}
else
{
w[0] = w[1];
w[3] = w[4];
w[6] = w[7];
}
}
if (i < Xres - 1)
{
w[2] = *(sp + prevline + 1);
w[5] = *(sp + 1);
w[8] = *(sp + nextline + 1);
}
else
{
if (seamless)
{
w[2] = *(sp + prevline - Xres + 1);
w[5] = *(sp - Xres + 1);
w[8] = *(sp + nextline - Xres + 1);
}
else
{
w[2] = w[1];
w[5] = w[4];
w[8] = w[7];
}
}[/code]
I'll separate the flags for X and Y wrapping later.
This is amazing. Is there a percentage on how much detail had to be added?
So what's going on with Octree CarlBooth?
[QUOTE=CarlBooth;28769384]Fucking nostalgia bomb;
From about 2002-2008 I was really in to WWE (as most teenagers are). I was part of a forum (where I first met SteveUK, small world) where we modded the shit out of a crappy WWE game. In late 2004 I started making my own game for that forum using Blitz3D.
Bear in mind that in 2004, the only programming experience I had was with VB6 and I'm not sure if anyone has used Blitz3D but there is literally no OOP in it at all. The only thing you can make that resembles any form of OOP is basic Types. Never the less with relatively no programming experience and the most god-awful 3D programming tools known to man, I somehow managed to get this game to the state where you could play through like 30 of the wrestler's entrances with music, videos, lights, pyro particles, camera angles - everything. It consists of over 8,000 lines of code, most of it copy/pasted due to lack of classes.
I worked at it on and off for about 4 years and then it became buried on my server and I had totally forgotten about it until roughly a week ago when I discovered it whilst looking for something else completely different.
Amazingly it still works, so naturally - Pics:
I decided that this was too awesome to lose, and I've been wanting a decent 3D project to do in XNA, so I've decided that this is going to be it.
[b]XNA Porting Progress[/b]
Lights Working
I haven't watched WWE for years but I'm gonna do this just because it brings back so many happy memories.[/QUOTE]
oh god i still have that game somewhere :v: nice
[QUOTE=Ortzinator;28773629]So what's going on with Octree CarlBooth?[/QUOTE]
Seems like he's busy with other, more important stuff.
Finally got farseers working and I have set it up so i only have to pass the player sprite, tile image & the map array (which is currently a 2 dimension array of ints) into my level class and it creates the level like this :D
[media]http://www.youtube.com/watch?v=_HabY4rVVmU[/media]
Does anyone know a solution for the 2px gap between the player and the world?
[QUOTE=Richy19;28775122]Finally got farseers working and I have set it up so i only have to pass the player sprite, tile image & the map array (which is currently a 2 dimension array of ints) into my level class and it creates the level like this :D
[media]http://www.youtube.com/watch?v=_HabY4rVVmU[/media]
Does anyone know a solution for the 2px gap between the player and the world?[/QUOTE]
Shrink the collision box by 2px or expand the player sprite by 2px
I went all "Fuck you FreeGLUT and SFML" and made my own window manager (windows and X11). :3
[img]http://dl.dropbox.com/u/23989104/WHURHURHURHURR.png[/img]
[cpp]#include "window/window.hpp"
class DerivedWindow : public wm::window {
public:
DerivedWindow(): window(){}
DerivedWindow(int w, int h, std::string name=""): window(w,h,name){}
void OnMouseButton(MOUSE_BUTTON button, bool state){
std::cout<<"Mouse Button "<<button<<" in window number "<<mIdentifier<<" has been "<<(state?"pressed":"released")<<"!"<<std::endl;;
}
};
int main(int argc, char ** argv){
DerivedWindow Window(300,300,"Window Title");
DerivedWindow Window2;
Window2.SetTitle("WHURHURHURHURRR");
Window2.SetSize(1000,70);
Window2.Show();
while(wm::HasActiveWindows())
wm::Main();
}
[/cpp]
Got saving and loading complete, here's some screen shots. I'll put them in media tags since they're pretty big:
I decided to plant some flowers at night, since I think it'll look pretty over there in the corner:
[media]http://i54.tinypic.com/do9cuo.jpg[/media]
Then, in the morning, I launch my game and what do you know, they're still there, along with a flower I picked up during last night as well
[media]http://i55.tinypic.com/1immw3.jpg[/media]
Then, I play again in the after noon, and decide to make some more cash, since $75 dollars wasn't doing it. :P
[media]http://i51.tinypic.com/65sxme.jpg[/media]
[QUOTE=AtomiC0l;28775322]Shrink the collision box by 2px or expand the player sprite by 2px[/QUOTE]
[IMG]http://i52.tinypic.com/j7q5oo.jpg[/IMG]
Stop it guys I was being serious
Arg, args are annoying.
Incoming horribly low quality .gif of a work in progress by Inzuki and me. :smith:
[img]http://localhostr.com/files/IHCCBa7/horizon.gif[/img]
Quality doesn't look that bad :v:
And the buttons do sort of highlight when you hover over them.
[img]http://i.imgur.com/FzLkv.png[/img]
[QUOTE=WeltEnSTurm;28776628]I went all "Fuck you FreeGLUT and SFML" and made my own window manager (windows and X11). :3
[img_thumb]http://dl.dropbox.com/u/23989104/WHURHURHURHURR.png[/img_thumb]
[cpp]#include "window/window.hpp"
class DerivedWindow : public wm::window {
public:
DerivedWindow(): window(){}
DerivedWindow(int w, int h, std::string name=""): window(w,h,name){}
void OnMouseButton(MOUSE_BUTTON button, bool state){
std::cout<<"Mouse Button "<<button<<" in window number "<<mIdentifier<<" has been "<<(state?"pressed":"released")<<"!"<<std::endl;;
}
};
int main(int argc, char ** argv){
DerivedWindow Window(300,300,"Window Title");
DerivedWindow Window2;
Window2.SetTitle("WHURHURHURHURRR");
Window2.SetSize(1000,70);
Window2.Show();
while(wm::HasActiveWindows())
wm::Main();
}
[/cpp][/QUOTE]
No love for the Cocoa :smith:
Hey bros. I posted somewhere on first page about me becoming the programing king and I believe I am well on my way there. However I'm kinda in a road block of my roleplay journey to become the very best. As of now I can p much make what ever the shit I want in a UNIX console. I use functions and make really cool outputs and shit. I'm currently learning how to use text files to fetch shit and what not. How much longer until I can make Crysis 4? And by Crysis 4 I mean when will I be able to code outside of this shitty console?
I got a 50 out of 100 on my last lab. We were suppose to make a program that generates an addition problem, then you just press enter for it to show the problem. I made an all in one calculator + like 10 different types of problems that the program will generate, all formatted in a really nice output box that clears & refreshes the console every time you navigate the menus . On my graded lab I got the words "we are not there yet" on the top.
As soon as you download one of them graphics things :v:
[editline]23rd March 2011[/editline]
Well, my code that is supposed to make variables throughout a script be their value so they can be used in evaluation works, occasionally :saddowns:
[editline]23rd March 2011[/editline]
Wait, I just encountered the first scope-confusion in the history of Shkrim.
I guess I made classes too well.
[editline]23rd March 2011[/editline]
This code:
[code]System
Math
int y = 5
int x = y
int z = x
var d = {3, y}
Text
string your = "mother"
DefTest
var d = {3, y}
def z{q, p}
return q[/code]
Results in this horribly messy console:
[img]http://ahb.me/2gkX[/img]
6 days to release, the guy on the team who is expected to do nothing but keep up contact with the charity decided to NOT let us know that they emailed us 10 days ago saying their waiting for us to set up the shared Android Market account - we asked him today, he said he tried emailing them and calling them but got no response.
Upon sending a reply email from a new gmail account, we got an auto out-of-office reply. Apparently she won't be able to take calls or email until (you guessed it) 6 days from now.
GOOD NEWS: we cut some things that we couldn't get done in time, level editor is so very close to done, I'm just patching bugs that my friends find, the very last game dynamic is being wrapped up right now (teleporters). Art is also very close to done, I just need to toss it into tilesets. We're going to finalize the UI and put some fancy borders around it and make a bunch of levels, and include the music I had a friend of mine make, and we're going to release it.
ALSO WE HAVE A NAME, FINALLY - "Circuit Crawler", and it took us long enough to come up with it.
here, have some main menu... I'm planning on changing the buttons on the left to a listView so that we can scroll through the list and not have to abbreviate things like "Youth for Technology Foundation" - which is the charity that will recieve 100% of the profits from this game.
[img]http://i.imgur.com/5l4Kx.png[/img]
[editline]23rd March 2011[/editline]
and yes, that logo on the left there is still a WiP, probably going to make that text gold and have smaller red lines running all over the place
[QUOTE=xAustechx;28776632]-unusual images-[/QUOTE]
oh god stop
[QUOTE=DrLuke;28773205]Is there a percentage on how much detail had to be added?[/QUOTE]
You mean in terms of code modified except for porting and refactoring?
For the wrapping it's only the if(seamless == true) branches.
The alpha support is one added line wherever colors are compared or interpolated, wich means something between 10 and 15 lines.
Most of this stuff is already in the original code somewhere, I just had to use it a bit differently.
[editline]24th March 2011[/editline]
He meant CarlBooth's XNA port, right? I was reading on my phone, didn't watch the vids and got confused by the rating. Sorry.
Update:
- added X and Y wrapping
- added background sliders for transparency tests
- added scroll bars (only appear when needed)
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/Resizer_Background.png[/img]
You can download the current version here: [url]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/Tamschitty%20Resizer%200.1.zip[/url]
[QUOTE=Tamschi;28780635]You mean in terms of code modified except for porting and refactoring?
For the wrapping it's only the if(seamless == true) branches.
The alpha support is one added line wherever colors are compared or interpolated, wich means something between 10 and 15 lines.
Most of this stuff is already in the original code somewhere, I just had to use it a bit differently.
[/QUOTE]
I meant, how much detail had to be addded to the picture, like 100% more detail or 500% more detail (or pixels if you wish)
[QUOTE=xAustechx;28776632][media]http://i51.tinypic.com/65sxme.jpg[/media][/QUOTE]
Why is the Quake disc 3 times bigger than the other discs? :v:
[QUOTE=DrLuke;28783076]I meant, how much detail had to be addded to the picture, like 100% more detail or 500% more detail (or pixels if you wish)[/QUOTE]
So you were really talking about my program? Thanks!
It's just a port of an existing algorith though, so it's limited to doubling, tripling and (sooner or later) quadrupling the image dimensions.
The hqx algorithm is using precomputed anti-aliasing, so I guess I could try writing one that works with any number of pixels as magnification, but that would run a lot slower.
just finished working on my app, upScreen. You can find it here:
[url]https://sourceforge.net/projects/upscreen/[/url]
What it does:
it's like gyazo, but it uploads to your host, via FTP. More info can be found here:
[url]http://sharpmindprojects.com/project/upscreen[/url]
C&C? I might also make a thread about it later.
[QUOTE=Ortzinator;28773629]So what's going on with Octree CarlBooth?[/QUOTE]
I work in a school and I'm currently developing an online reporting system for parents which is quite heavy on database stuff (pulls a lot of data from the school's MIS system across to MySQL) so I currently have my dev. machine set up with SQL instances and IIS for managing and building that system.
I don't want to have Octree on the same machine as it's a non-work project so I can't really do a lot with it until this reporting system is out of the way and running on different hardware.
I asked Steve to close the thread because people were getting naggy about it.
[QUOTE=BlkDucky;28783546]Why is the Quake disc 3 times bigger than the other discs? :v:[/QUOTE]
Gamecube games.
Jeez I'm so offtopic..
Guess I added saving to my physics game. Hooray.
[QUOTE=CarlBooth;28784264]I work in a school and I'm currently developing an online reporting system for parents which is quite heavy on database stuff (pulls a lot of data from the school's MIS system across to MySQL) so I currently have my dev. machine set up with SQL instances and IIS for managing and building that system.
I don't want to have Octree on the same machine as it's a non-work project so I can't really do a lot with it until this reporting system is out of the way and running on different hardware.
I asked Steve to close the thread because people were getting naggy about it.[/QUOTE]
Good luck with that reporting system, may the 'nop' not be with you!
Working on the hq4x port:
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/Undefiner.png[/img]
The Un#definer is full of ugly and slow code and replaces all line endings with the ones used by the current operating system, but otherwise it should work fine.
Download: [url]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/Un%23definer.exe[/url]
Sorry, you need to Log In to post a reply to this thread.