Oh the interesting qualities of programming...o_O I've decided to scrap my XNA project and remake it, because the organization is so bad on the old one. It would be best to have something more organized first. Fortunately I have a better idea of what I want to do now, and I have been working on some documentation now, instead of just going all over the place, and having no set idea of what i want for the program.
Now, to be honest, I'm at a bit of a cross roads between making an RPG or making a platformer...the RPG would be a bit less mathematically challenging...and I would use a fairly simple system for the program, think old school FF style system. Probably with the visual qualities of FF1, and potentially a system like 6...although that's still up in the air.
However, something like that requires a lot more organization, and far less spaghetti code...>.> I've been known to have small sections of spaghetti code. My main problem is that I don't want to go back and forth between program ideas, and organizations, because I don't want to get stuck with 50 unfinished projects. Any advice from my few readers out there?
Saturday, June 30, 2012
Crossroads
Labels:
C#,
C++,
computer,
creation,
d3,
Diablo 3,
game,
Game Maker,
games,
Programming,
programs,
Torque,
Torque Game Builder,
Torque Game Engine,
video,
video games,
XML
Wednesday, June 27, 2012
Kind of update?
No new news, just updating because my comics apparently just came out...>.> I don't have a lot of plans tonight, although i'm drinking some alcohol with my dad tonight. Tis a rare happening, and it's always nice. :-) So yeah, no updates on the program, just booze...
Labels:
C#,
C++,
computer,
creation,
game,
Game Maker,
games,
Java,
Programming,
programs,
repair,
ruby on rails,
Torque,
Torque Game Builder,
Torque Game Engine,
video,
video games,
XML
Sunday, June 24, 2012
Updated collision detection with ray casting that actually functions but needs more testing!
Alright, so there might be good news...From what I can tell my ray casting algorithm is working so far, however the movement is still very umm....bad. But, I'm quite glad to see my ray casting algorithm works. I'll be working on it some more for initial circle collision, then the ray casting detection for more accurate collision detection. At the moment I'm watching Psych...I'm on season 2 so far so good. Rather silly, as always, but I never can focus on my programming...I went ahead and posted a few lines of code from my work. If any readers want to comment on the code, shoot me a comment, I'll read over it and reply. I'd be glad to hear about things i can do to improve. :-)
Basic method for checking if a point intersects a segment. Edge class contains 2 Vector2's, p1 and p2, which act as a 2D point in electronic nether-space.
protected bool RayIntersectsSegment(Vector2 p, Edge edge, Vector2 world)
{
//This method is strictly used for checking if the specific point p intersects the edges points.
//First we need to find the 2 vector values a and b. a must be below b on the y axis.
Vector2 a;
Vector2 b;
float red;
float blue;
//Check which one's above and which one's below. And then increment them by the world translation. It's very important that we do that...
if (edge.p1.Y >= edge.p2.Y)
{
a = edge.p2 + world;
b = edge.p1 + world;
}
else
{
a = edge.p1 + world;
b = edge.p2 + world;
}
if (p.Y == a.Y || p.Y == b.Y)
{
p.Y += 2; //Magic number used to increment y just a little bit to get it out of the path of the vertex itself.
}
if (p.Y < a.Y || p.Y > b.Y)
{
return false;
}
else if (p.X > Math.Max(a.X, b.X))
{
return false;
}
else
{
if (p.X < Math.Min(a.X, b.X))
{
return true;
}
else
{
if (a.X != b.X)
{
red = (b.Y - a.Y) / (b.X - a.X);
}
else
{
red = float.PositiveInfinity;
}
if (p.X != a.X)
{
blue = (p.Y - a.Y) / (p.X - a.X);
}
else
{
blue = float.PositiveInfinity;
}
if (blue >= red)
{
return true;
}
else
{
return false;
}
}
}
}
This method is called in this series of loops here. The object vertices is a List of vertices, and the object boEdges contains the list of Edge objects in the other polygonal object.
foreach (Vector2 cp in vertices)
{
int bcounter = 0;
Vector2 cpw = cp + parent.position + parent.origin + offset; //Translated to the world.
Vector2 oWorld = other.position + other.origin + box.offset;
//then check for every edge in oe.
foreach (Edge oe in boEdges)
{
if (RayIntersectsSegment(cpw, oe, oWorld))
{
bcounter++;
}
}
if (bcounter % 2 > 0)
{
//If the counter turns out to be odd, return true.
return true;
}
}
If I got anything seems wrong, give me a holler, I'm all ears. :-D Also, this was created in C# using the XNA Framework.
Basic method for checking if a point intersects a segment. Edge class contains 2 Vector2's, p1 and p2, which act as a 2D point in electronic nether-space.
protected bool RayIntersectsSegment(Vector2 p, Edge edge, Vector2 world)
{
//This method is strictly used for checking if the specific point p intersects the edges points.
//First we need to find the 2 vector values a and b. a must be below b on the y axis.
Vector2 a;
Vector2 b;
float red;
float blue;
//Check which one's above and which one's below. And then increment them by the world translation. It's very important that we do that...
if (edge.p1.Y >= edge.p2.Y)
{
a = edge.p2 + world;
b = edge.p1 + world;
}
else
{
a = edge.p1 + world;
b = edge.p2 + world;
}
if (p.Y == a.Y || p.Y == b.Y)
{
p.Y += 2; //Magic number used to increment y just a little bit to get it out of the path of the vertex itself.
}
if (p.Y < a.Y || p.Y > b.Y)
{
return false;
}
else if (p.X > Math.Max(a.X, b.X))
{
return false;
}
else
{
if (p.X < Math.Min(a.X, b.X))
{
return true;
}
else
{
if (a.X != b.X)
{
red = (b.Y - a.Y) / (b.X - a.X);
}
else
{
red = float.PositiveInfinity;
}
if (p.X != a.X)
{
blue = (p.Y - a.Y) / (p.X - a.X);
}
else
{
blue = float.PositiveInfinity;
}
if (blue >= red)
{
return true;
}
else
{
return false;
}
}
}
}
This method is called in this series of loops here. The object vertices is a List of vertices, and the object boEdges contains the list of Edge objects in the other polygonal object.
foreach (Vector2 cp in vertices)
{
int bcounter = 0;
Vector2 cpw = cp + parent.position + parent.origin + offset; //Translated to the world.
Vector2 oWorld = other.position + other.origin + box.offset;
//then check for every edge in oe.
foreach (Edge oe in boEdges)
{
if (RayIntersectsSegment(cpw, oe, oWorld))
{
bcounter++;
}
}
if (bcounter % 2 > 0)
{
//If the counter turns out to be odd, return true.
return true;
}
}
If I got anything seems wrong, give me a holler, I'm all ears. :-D Also, this was created in C# using the XNA Framework.
Labels:
C#,
C++,
computer,
creation,
game,
Game Maker,
games,
Java,
music,
Programming,
programs,
repair,
Torque,
Torque Game Builder,
Torque Game Engine,
video,
video games,
XML
Saturday, June 23, 2012
Latest update.
Alright! I have good and bad news for the day. I set up a basic raycasting system for my XNA engine project. It works, however I'm getting a lot of errors with it. -_- So, I'm mostly back to square one, but I have a working system up that I just need to figure out what's wrong...essentially. I'm guessing it has a few other problems going on right now, but I'm working on it.
The problem I'm having is that I can't visualize the segments very well. I can visually mark the vertices, however I can't make the edges. For now, vertices work though.
The Player object is also animating well...I have a series of sprites that are very basic, but work fine for now. The animation also has different beginning and end sections as well, so the animation will run to a specific point, and then when it's done there, it starts back up at a specific point. It runs from left to right, then back to left on a new row, once it's exhausted that first row. So you can't have little sections of animation, like a square in the corner dedicated to running, a square in the corner dedicated to jogging, and a square between dedicated to something else...essentially. Here, I'll draw a diagram, hope it helps, cause it took me a while to make.
[run ][----][----][----][----][----]
[/run][jog-][----][----][----][/jog]
[fall][jump][----][----][----][----]
That diagram would work. The last 4 tiles in the lower right hand corner can be whatever the fuck you want, idc...but, you can actually make one frame specific to one thing, and it will "animate", essentially.
Run will last until /run, same with jog, fall and jump are individual single frames for the action. Eric should understand this pretty well...Anyway, there's no limit on size, so far as I know, but it's best to keep it small and simple I would imagine.
As for things that won't work, here's a good example.
[run][run][run][jog][jog][jog]
[run][run][run][jog][jog][jog]
This will not work, because it runs sequentially through this process from left to right in a row, then down a row back to the left, like I said. :-)
Anyway, enough said, I will be back in a few days with a new update! :-D
The problem I'm having is that I can't visualize the segments very well. I can visually mark the vertices, however I can't make the edges. For now, vertices work though.
The Player object is also animating well...I have a series of sprites that are very basic, but work fine for now. The animation also has different beginning and end sections as well, so the animation will run to a specific point, and then when it's done there, it starts back up at a specific point. It runs from left to right, then back to left on a new row, once it's exhausted that first row. So you can't have little sections of animation, like a square in the corner dedicated to running, a square in the corner dedicated to jogging, and a square between dedicated to something else...essentially. Here, I'll draw a diagram, hope it helps, cause it took me a while to make.
[run ][----][----][----][----][----]
[/run][jog-][----][----][----][/jog]
[fall][jump][----][----][----][----]
That diagram would work. The last 4 tiles in the lower right hand corner can be whatever the fuck you want, idc...but, you can actually make one frame specific to one thing, and it will "animate", essentially.
Run will last until /run, same with jog, fall and jump are individual single frames for the action. Eric should understand this pretty well...Anyway, there's no limit on size, so far as I know, but it's best to keep it small and simple I would imagine.
As for things that won't work, here's a good example.
[run][run][run][jog][jog][jog]
[run][run][run][jog][jog][jog]
This will not work, because it runs sequentially through this process from left to right in a row, then down a row back to the left, like I said. :-)
Anyway, enough said, I will be back in a few days with a new update! :-D
Labels:
C#,
C++,
computer,
creation,
d3,
Diablo 3,
game,
games,
Java,
music,
Programming,
programs,
repair,
Torque,
Torque Game Builder,
Torque Game Engine,
video games,
XML
Thursday, June 21, 2012
Game Engine finally done...but not for Impulse Strike 2. :-(
Alright, just finalized my GSP420 class, and that included making a demo with a game engine we developed as a team. The team included everyone in the GSP 420 class, which is awesome. I would say I wrote my own game engine, but that would be a complete and utter lie, sadly. I just wrote the configuration xml parser, and a variety of small code sections.
Oh I have found my next new love...XML. Apparently C# has a decent XML parser class, which is pretty badass. I utilized that parser to create levels from an XML document. I'll be working on creating a nifty level editor with it, so I can update and adjust the level document outside of the class. :-D Will be epic.
As for IS2, there's really no updates, this engine class has taken over most of my mornings, and my nights are filled with watching anime lately...>.> And Monk...I love that show. I've also been watching South Park every so often. It's a very unique show...not as bad as Drawn Together, but still killing off brain cells slowly...
Anyway, gonna go find my song of the day, post that, and see you all later. Take care.
Oh I have found my next new love...XML. Apparently C# has a decent XML parser class, which is pretty badass. I utilized that parser to create levels from an XML document. I'll be working on creating a nifty level editor with it, so I can update and adjust the level document outside of the class. :-D Will be epic.
As for IS2, there's really no updates, this engine class has taken over most of my mornings, and my nights are filled with watching anime lately...>.> And Monk...I love that show. I've also been watching South Park every so often. It's a very unique show...not as bad as Drawn Together, but still killing off brain cells slowly...
Anyway, gonna go find my song of the day, post that, and see you all later. Take care.
Labels:
C#,
C++,
computer,
creation,
d3,
Diablo 3,
game,
Game Maker,
games,
Java,
Programming,
programs,
repair,
ruby on rails,
Torque,
Torque Game Builder,
Torque Game Engine,
video,
video games,
XML
Wednesday, June 20, 2012
AGH! No posts lately! The horrors!
:-O I haven't posted in ages. Of course, I haven't made any updates in ages either. I can blame Eric for that :-P He got me started on SC2 again...check out my facebook if you want to see some pics of our crazy adventures on there. We were playing a Terran survival match with only marines...was quite entertaining to say the least. Lots of blood gore and "You want a piece of me, boy?" :-P
Oh fun times...anyway, as far as updates go, I haven't gotten anything new lately, it's been rather boring on that front. I've been very busy with finishing up a game engine for class, I'll post that once we're all finished up with it, and people can fiddle around with it as they see fit. It's really simple (very...very...very...simple.) and probably has more memory leaks and unused code than I'd like to admit, but that's just because it was a team effort where people couldn't agree on how things would work. And a few people on the AI team seemed to be very green at programming C++.
Of course, I'm still pretty green myself. I can made the XML Parser in C++ using TinyXML2, which is fairly simple and easy to use. However, that was basically my introduction to advanced C++ programming...after 5 years of programming in various other languages like Java, C#, and Visual Basic. I've grown very fond of C# though...and XNA. Once I got the O'Reilly book about XNA, I'm so happy to see I can do a lot with it. I just need to learn more math and physics. I feel like despite nearing my Bachelors degree, I still have yet to touch on a full understanding of the mathematical functions I use. I just use them, and if they work great, if they don't, I beat it with a stick and do everything I can to understand why it's not working. And if all else fails, I continue the beatings, and then give up.
So yeah, no new updates, just me babbling about stuff going on. :-) Take care.
Labels:
C#,
C++,
computer,
creation,
d3,
Diablo 3,
game,
Game Maker,
games,
Java,
PHP,
Programming,
programs,
repair,
ruby on rails,
Torque,
Torque Game Builder,
Torque Game Engine,
video,
video games
Thursday, June 14, 2012
Hello my readers of awesome...Sorry for the 6 day delay between updates...I've been quite busy trying not to die on Diablo 3. Finally made it to Inferno and I went from being somewhat squishy to super squishy...-_- Even with 56% damage decrease in defense, I take like...40k damage from really annoying rares, or champions, and bosses. I was one shotted by a mob, and yet I could take down Diablo on Hell in one go...how the fuck does that happen? When did Diablo's minions become more powerful than him...o.o
Anyway, enough with my rant on Diablo 3...I'm looking forward to the next couple of days. Eric and I have redirected our game idea a little bit. I'd rather not get into that too much, but it's still a platformer. Personally, I've been a big fan of platformers since I played the original Spyro game. I'm quite happy with the direction we're going, I would just like to get some work done on it. We're definitely sticking with Torque for the new direction as well, so hopefully we can get something simple out soon on the website.
The reason behind the redirection/change was primarily because of art assets. Eric's artwork is good, but he's pretty busy with school and work, and various other life...things...anyway, he's busy, so he can't work on the program if he's doing art all the time, and Impulse Strike has always had very complicated artwork associated with it. If we can get the art pumped out of the way, we'll be fine...Was the original idea behind asking Summer to help, however that has gone nowhere so far. -_- Very disappointed with that, but I didn't expect it to go very far originally, was just hoping she would want to have a side project or something she could add to her portfolio.
Anyway, enough with my rant on Diablo 3...I'm looking forward to the next couple of days. Eric and I have redirected our game idea a little bit. I'd rather not get into that too much, but it's still a platformer. Personally, I've been a big fan of platformers since I played the original Spyro game. I'm quite happy with the direction we're going, I would just like to get some work done on it. We're definitely sticking with Torque for the new direction as well, so hopefully we can get something simple out soon on the website.
The reason behind the redirection/change was primarily because of art assets. Eric's artwork is good, but he's pretty busy with school and work, and various other life...things...anyway, he's busy, so he can't work on the program if he's doing art all the time, and Impulse Strike has always had very complicated artwork associated with it. If we can get the art pumped out of the way, we'll be fine...Was the original idea behind asking Summer to help, however that has gone nowhere so far. -_- Very disappointed with that, but I didn't expect it to go very far originally, was just hoping she would want to have a side project or something she could add to her portfolio.
Labels:
C#,
C++,
computer,
creation,
d3,
Diablo 3,
game,
games,
Java,
music,
PHP,
Programming,
programs,
ruby on rails,
Torque,
Torque Game Builder,
Torque Game Engine,
video,
video games
Subscribe to:
Posts (Atom)