Welcome, Guest. Please login or register.
November 22, 2014, 12:01:15 PM

Login with username, password and session length
Search:     Advanced search
We have a new board! Pop on over to the Game Journals section and tell us what you've been playing!
337941 Posts in 13835 Topics by 2212 Members
Latest Member: WhiteWishes
* Home Help Search Login Register
+  RPGFan Message Boards
|-+  Media
| |-+  Single-Player RPGs
| | |-+  I can make games? Journal
« previous next »
Pages: 1 [2] 3 Print
Author Topic: I can make games? Journal  (Read 8062 times)
Fei
Posts: 1336


!?

Member
*


View Profile

Ignore
« Reply #15 on: September 13, 2009, 06:31:09 PM »

I am currently reading about Direct3D8.  It's way out of date, but I have a book on it and figure it'll be fine for learning basics of 3D rendering.

I didn't like aspects of XNA Game Studio, and I'm still using Visual C++ 6 (mega old), so I think it's reasonable for me to be doing this.  So far, I have made some 2D spinning triangles.
Logged

If you re-spec your elduhz and own a Vita - http://twitter.com/BSNursery
MeshGearFox
Posts: 8693


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #16 on: September 13, 2009, 09:45:04 PM »

I decided to entirely rewrite Quogue using a top-down design approach. Currently I have a game loop written, but otherwise no functional code. However, I know what I'm trying to write this time.

My current concern is that I THINK my Level class might be leaning towards being a rather sloppy God Class. CURRENTLy, or at least how I'm intending it, it'll be a large, essentially singleton (bad for this, but in a later program where I have multiple levels...) class that stores the map's layouts, collision layer, and actors (where actor is loosely defined as player, pickup, jumppad, or projectile). It has absolutely no functionality in and of itself. It's just a large, compositional container class. Actually functionality -- such as projectile movement or player movement -- is relegated to the specific classes (IE, there's not Level level movement function. Only player.move(), projectile.move(), etc.)

(Additionally there are external movement functions which are mostly there to provide another layer of abstraction and do stuff like call every projectiles movement command in sequence).

---edit---

Okay, figure something out with how I need to structure actor data.

Actors, here, are defined as any entity in a level that actually does something. In my case, that'd be the player, projectiles, jumppads, and pickups (and bots, if I ever implement them). Originally, I had a single Actor class containing arrays of each kind of actor. However, I couldn't come up with an elegant manner of dealing with all these things. So, for the time being, I came up with an interesting kludge to mimic inheritance.

There's an Actor class, which contains a pointer to either a jumppad or a pickup (projectiles and players are now handled differently). Additionally, there's an integer specifying which 'class' the Actor holds.

As I said, kind of a kludge, but it seems like it should work. Now I can, say, have a single getActor function which will locate any given actor in the list with any given ID (because Actor ID is in the actor object and not the specific subtype it's pointing too), and then call THAT specific actors functions based on it's type id.

I might also be able to move the subtype functionality to the Actor container class, by having a function pointer to, say, getName in the actor class, that'll either point at jumppad.getName or pickup.getName, and calling actor.getname will immediately call the right function because function pointer wizardry is awesome

---edit---

Tried rewriting this in C++. Remembered how much I hate C++.
« Last Edit: September 18, 2009, 11:24:43 PM by MeshGearFox » Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

Fei
Posts: 1336


!?

Member
*


View Profile

Ignore
« Reply #17 on: September 19, 2009, 02:11:50 AM »

Welcome back to the dark side!  I was wondering how you were able to attempt polymorphism and all that with FreeBasic... you have experience!

I just learned how to load vertices into a vertex buffer.  I'm going to pick up the pace though; most of what I'm dwelling on is going to fade into the background once I start making an actual game.  The "boilerplate code" that XNA removes from programmers is what is taking up most of my time, haha.
Logged

If you re-spec your elduhz and own a Vita - http://twitter.com/BSNursery
MeshGearFox
Posts: 8693


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #18 on: September 19, 2009, 02:38:50 AM »

I should learn XNA. It looks like it removes some of the retardation from C++.

Quote
I was wondering how you were able to attempt polymorphism and all that with FreeBasic...

Sort of. Virtual functions aren't hard. You just need function pointers to simulate it. The "pointer to base class can take subclass" stuff I sort of worked out. I found two solutions on the forums. One involved stuff with typecasting I didn't get. The other one was fairly easy. I'll put my current code up later. I have no idea if it works, mind, as I've never compiled it yet, but it should.

Quote
you have experience!

??? I've been using FreeBASIC for like two weeks.

Anyway, that code I was talking about. I'll post an explanation in a new post.

#ifndef ACTOR_TYPES
#define ACTOR_TYPES

Rem Done - class and fmethods.
Type SpawnPoint
    Declare Constructor (Dim _x As Integer, Dim _y As Integer)
   
    Rem Essentially, a spawn point is a map object that holds a
    Rem valid place where a player can spawn.
    Dim posX As Integer
    Dim posY As Integer
   
end type

Rem Done - calss and methods.
Type Jumppad
    Declare Constructor(Dim _direction As Integer, Dim _distance As Integer, Dim _speed As Integer)
   
    Rem How far the player moves when launched.
    Dim distance As Integer
    Rem The direction the player moves in when launched.
    Dim direction As Integer
    Rem Speed at whic ha player moves when launched. 0 means instantenous teleportation.
    Dim speed As Integer
   
    Rem Defines what happens when the player steps on the jumppad.
    Declare Function collisionEvent(ByRef activePlayer As Player) As Integer
end type

Rem Done - class and methods.
Type Pickup
    Declare Constructor(Dim _itemType As Integer, Dim _respawnTime As Integer)
   
    Rem Signifies what type of item the pickup spawns.
    Dim itemType As Integer
    Rem When set to 1, the Pickup currently has an item spawned and
    Rem the countdownTimer is not updating.
    Dim active As Integer
    Rem The amount of time it takes to re-spawn a particular pickup.
    Dim respawnTime As Integer
    Rem Initially set to respawnTime, reduces each turn and when it hits
    Rem zero, reactivates the pickup.
    Dim countdownTimer As Integer
   
    Rem Controls timer countdown.
    Declare Function reduceTimer() As Integer
   
    Rem Event that happens when the timer hits zero.
    Declare Function timeoutEvent() As Integer
   
    Rem Event that happens when the player steps on the pickup.
    Declare Function collisionEvent(ByRef activePlayer As Player) As Integer

end type

Rem Done.
Union actorClass
    uJumppad As Jumppad Ptr
    uPickup As Pickup Ptr
    uSpawnpoint As Spawnpoint Ptr
end union


Rem Done - class and methods.
Type Actor
    Rem Each actor has a unique ID to facilitate collision detection.
    Dim ID As Integer
    Rem Number identifying which class the Actor represents.
    Dim class As Integer
   
    Rem Union stores a pointer -- and only one pointer -- to the Actor's specific 'class'.
    Dim classType As actorClass
end type

Rem Done - class and methods.
Type ActorClassHandler
    Rem Array storing ever actor in the game.
    Dim actors(1 to MAX_ACTORS) As Actor Rem Dim actors(1 to MAX_ACTORS) As Projectile
   
    Rem The last ID assigned. Always assigns this + 1 + MAX_PLAYERS
    Dim IDBase As Integer

    Rem Returns a pointer to an actor.
    Declare Function locateActor(lookupID As Integer) As Actor Ptr

    Rem Load actors into memory.
    Declare Function loadActor(classID As Integer, actorData As String) As Integer
   
end type

#endif
Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

MeshGearFox
Posts: 8693


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #19 on: September 19, 2009, 02:47:12 AM »

Okay. A union is a type, where all the members are stored in the same place in memory, and as such only one can be accessed at any time.

The Actor type i my base class here. It contains, among other bits of data, a class identifier integer and a union of type actorClass.

How this works is that the loadActor function in actorClassHandler sets one of the pointers in the union to a new whatever, and it can *NEVER BE CHANGED AGAIN*. and the other things in that union aren't accessible either.

The class identifier is an integer specifying what class is supposed to be in there so you know which element of the union to access.

So basically I can store every actor in a single array and use the ActorClassHandler to perform some very general actions on them (loading them, searching through them), and then check their identifier and access the proper element of the union to do more specific things.

It's not perfect but it works. I could probably do something more graceful with operator overloading.

---edit---

Bought a book on XNA. Started working through it. C# is more businically viable than FreeBASIC.

---edit2---

I have to admit, this XNA stuff is inspiring me. Also, I realized that my class structure in Quogue is essentially mimicking namespaces. Some of the things are still sort of tricky since FreeBASIC lacks real, uh, polymorphism though, meaning I really wouldn't want to embed update and draw functions in ever object.

The gameComponent system seems particularly elegant.

It seriously feels fucking good to be working through a *book* instead of something online. The feeling of paper is *amazing*.

---edit3---

worked on quogue. This is my movement code. It has a bunch of crap in it to accomodate jumppads and (eventually?) rocket jumping and weapon kickback.

Function findOpenSpace(direction As Integer, distance As Integer, x As integer, y As Integer, testCollision As CollisionLayer) As Integer
    Dim i
   
    Rem This is a flag that checks to see if movement is blocked
    Rem in a given direction so that like a player can't be shot
    Rem through walls. Say the move distance is 3 and the map looks like
    '. <-
    '#
    '.
    '@
    'Rem the player would land in the marked space even though they're blocked
    Rem unless I check this.
    Rem explicity checking for a blocked flag might not be necessary... after all.
    Dim blocked As Integer
   
    i = 0
    blocked = 0
   
    Select Case direction
        Case NORTH
            Rem This first loop checks for obstructions.
            Rem I starts at 0, as it is possible to not move at all.
            For i = 0 To distance Step + 1
                Rem Make sure the distance is in bounds. If not, parse it as an onstructoin.
                If (posY - distance < 0) Then
                    distance = i
                    Rem Exit the for loop. This goes out from the player. Further obstructions are irrelevant.
                    Exit For
                ElseIf (testCollision.wall(posX, posY - distance) <> 0) Or (testCollision.actors(posX, posY - distance) <> 0) Then
                    Rem i how far till the player hits something, and is the real max distance.
                    distance = i
                    Exit For
                end if
            next
           
            Rem Check for the actual distance.
            For i = distance To 0 Step - 1
                Rem check to see if the position at distance i is clear. If so, return i.
                If (testCollision.wall(posX, posY - distance) = 0) And (testCollision.actors(posX, posY - distance) = 0) Then
                Return i
            next
           
        Case SOUTH
            For i = 0 To distance Step + 1
                If (posY + distance < 0) Then
                    distance = i
                    Exit For
                ElseIf (testCollision.wall(posX, posY + distance) <> 0) Or (testCollision.actors(posX, posY + distance) <> 0) Then
                    distance = i
                    Exit For
                end if
            next
           
            For i = distance To 0 Step - 1
                If (testCollision.wall(posX, posY + distance) = 0) And (testCollision.actors(posX, posY + distance) = 0) Then
                Return i
            next       
       
        Case EAST
            For i = 0 To distance Step + 1
                If (posX + distance < 0) Then
                    distance = i
                    Exit For
                ElseIf (testCollision.wall(posX + distance, posY) <> 0) Or (testCollision.actors(posX + distance, posY) <> 0) Then
                    distance = i
                    Exit For
                end if
            next
           
            For i = distance To 0 Step - 1
                If (testCollision.wall(posX + distance, posY) = 0) And (testCollision.actors(posX + distance, posY) = 0) Then
                Return i
            next
           
        Case WEST
            For i = 0 To distance Step + 1
                If (posX - distance < 0) Then
                    distance = i
                    Exit For
                ElseIf (testCollision.wall(posX - distance, posY) <> 0) Or (testCollision.actors(posX - distance, posY) <> 0) Then
                    distance = i
                    Exit For
                end if
            next
           
            For i = distance To 0 Step - 1
                If (testCollision.wall(posX - distance, posY) = 0) And (testCollision.actors(posX - distance, posY) = 0) Then
                Return i
            next                 
           
    end select
end function

Rem I think this is done but I don't have a clue if it works.
Function Player.move(direction As Integer, testCollision As CollisionLayer) As Integer
    Rem Store the last valid X and Y positions.
    this.lastX = this.posX
    this.lastY = this.posY
   
    Rem Move the player, either automatically or based on keyboard input,
    Rem with preemptive collision detection.
    If this.autoMoveFlag = 1 Then
        Select Case this.autoDirection
            Case NORTH
                this.posY = this.posY - findOpenSpace(autoDirection, autoSpeed, xPos, yPos, testCollision)
            Case SOUTH
                this.posY = this.posY + findOpenSpace(autoDirection, autoSpeed, xPos, yPos, testCollision)
            Case EAST
                this.posX = this.posX + findOpenSpace(autoDirection, autoSpeed, xPos, yPos, testCollision)
            Case WEST
                this.posX = this.posX - findOpenSpace(autoDirection, autoSpeed, xPos, yPos, testCollision)
        end select
       
        this.autoMoveTimeout = this.autoMoveTimeout - 1
        If this.autoMoveTimout = 0 Then
            autoMoveFlag = 0
        end if
   
    Else
        Select case direction
            Case NORTH
                Rem Make sure that the wall and actor collision layer are clear. If they are, move the player.
                If testCollision.wall(posX, posY - 1) = 0 And testCollision.actors(posX, posY - 1) = 0 Then
                    this.posY = this.posY - 1
                end if
            Case SOUTH
                If testCollision.wall(posX, posY + 1) = 0 And testCollision.actors(posX, posY + 1) = 0 Then
                    this.posY = this.posY + 1
                end if           
            Case EAST
                If testCollision.wall(posX + 1, posY) = 0 And testCollision.actors(posX + 1, posY) = 0 Then
                    this.posX = this.posX  + 1
                end if           
            Case WEST
                If testCollision.wall(posX - 1, posY) = 0 And testCollision.actors(posX - 1, posY) = 0 Then
                    this.posX = this.posX - 1
                end if               
        end select
    end if
end function
« Last Edit: September 23, 2009, 01:20:09 AM by MeshGearFox » Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

Fei
Posts: 1336


!?

Member
*


View Profile

Ignore
« Reply #20 on: September 23, 2009, 03:38:42 PM »

Yeah, books are awesome.  Looking stuff up online is good, but I end up jumping around too much while a book properly fleshes things out in the proper order.  I also think I do too many different things on my computer as my mind is a bit more scrambled compared to when I'm focused on a book.

XNA... the problem I ran into (and this may not be an issue anymore) was that you had to know exactly which image files you were ever going to use before you could use them, meaning you couldn't dynamically create resources.  I wanted to make a game with a separate level editor that would create files that the main game would use to create images, but XNA wanted the whole game to be set in stone; you had to drag whatever image assets into this content window before you could use them.  It's a design philosophy issue I guess.

Anyway, I am now reading about converting colors into the proper format for use in different video modes.  I can now load images that will soon be used as textures on my rotating triangles.  It is quite icky, but I'm glad to know how things work.
Logged

If you re-spec your elduhz and own a Vita - http://twitter.com/BSNursery
MeshGearFox
Posts: 8693


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #21 on: September 23, 2009, 05:27:00 PM »

That is sort of odd, admittedly, especially since it looks like you'd, uh, need to recompile if you just altered a resource. You CAN dynamically load 2D images with the Texture2D.FromFile method but that's it.

that would sort of render external editors... impossible, though, as well as any sort of propriety file format.

anyway it's not something I really plan on developing in. It's mostly just to learn with since the concepts are applicable in other systems.

---edit---

Then again, C# is a lot nicer than C++ (and I like freebasic too although I don't think it has garbage collection). Anyway.

The content pipeline makes sense for XBLA games which DO need to have all their resources packaged and aren't editable post release. You can also get VB or winForms or whatever to use the content pipeline so writing level editors is possible. Just... only if you have XNA Game Studio installed.
« Last Edit: September 23, 2009, 08:26:27 PM by MeshGearFox » Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

Fei
Posts: 1336


!?

Member
*


View Profile

Ignore
« Reply #22 on: September 24, 2009, 08:21:44 PM »

I've got one chapter left in part 1 of my book.  I just learned about multi-texturing, which is going to let me shade a poisoned character green.

I think I'm going to make a very basic tech demo that'll let you run around and get poisoned when I finish this next chapter.  People are probably bored by our technobabble, so it is time to produce tangible results!
Logged

If you re-spec your elduhz and own a Vita - http://twitter.com/BSNursery
MeshGearFox
Posts: 8693


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #23 on: September 27, 2009, 01:25:35 AM »

http://img36.imageshack.us/img36/6475/tilemockup.png

Not a game but tiles for a sidescroller I should make to learn XNA or game maker or something.
Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

Fei
Posts: 1336


!?

Member
*


View Profile

Ignore
« Reply #24 on: October 03, 2009, 06:26:42 PM »

Do it!  I (finally) finished part I of my book, so I'm going to make something silly using sprites I drew several years ago for an RPG project I never started.  I'll be done in a couple of days, because I am slacking pretty hard.

http://www.videogamesprites.net/SecretofMana/Party/ try using these sprites.  People will think "holy crap you busted out Secret of Mana in a matter of weeks?"
Logged

If you re-spec your elduhz and own a Vita - http://twitter.com/BSNursery
MeshGearFox
Posts: 8693


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #25 on: October 03, 2009, 08:20:52 PM »

Quote
http://www.videogamesprites.net/SecretofMana/Party/ try using these sprites.  People will think "holy crap you busted out Secret of Mana in a matter of weeks?"

??? What ???

right now I'm making sprites for Boolean RPG (Which is an RPG, and not a 3D, first-person chip's challenge clone like BOOLEAN RPG: THE PUZZLE ADVENTURE is supposed to be).
Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

Fei
Posts: 1336


!?

Member
*


View Profile

Ignore
« Reply #26 on: October 07, 2009, 12:43:29 AM »

I just spent several hours modifying 32 sprites after researching alpha testing (which allows for transparent pixels in Direct3D) and coding movement animation.

The result?  My character can run in 4 directions, and I only finished 3 of them properly (going up uses the left running sprites).  I should be able to share it tomorrow; it's about 160k zipped, with all of the bitmaps.  All it is is a homemade sprite running around a black background.

edit:  This texture stage crap is pissing me off.  I'll be happy to get away from this nitty gritty BS.
« Last Edit: October 07, 2009, 10:06:04 PM by Fei » Logged

If you re-spec your elduhz and own a Vita - http://twitter.com/BSNursery
Willy Elektrix
Lord of the Sword
Posts: 531


Member
*


View Profile

Ignore
« Reply #27 on: October 23, 2009, 08:16:11 PM »

I think I'm going to start on a new game soon. I've been toying with this idea for a long time now. It was a short story I wrote, but it would make a better game. It's called "The Hundred Deadly Doors: There Is No Escape".

Basically you wake in a room with ten doors. Behind almost all of the doors are fatal traps, but some let you move onto a new room (with more doors). You can die an infinite number of times with no penalty, and dying it actually necessary to solve some of the puzzles (for instance, one door, you must have died a certain number of times to enter). It would be more than just trial and error, because none of the rooms could solved by just trying every door until you find the safe doors. Some rooms require you to die a certain way or in a certain order, etc. It would be mostly linear as you conquered one ten door room and then moved to the next, but there will be a couple places where it branches.

Right now, I'm plotting out the rooms and puzzles. Hopefully I'll get into programming it in a couple weeks. It shouldn't be too labor intensive programming wise (I'm sure I'll regret saying that), but coming up with puzzles will be challenging.

Any ideas?
Logged
Fei
Posts: 1336


!?

Member
*


View Profile

Ignore
« Reply #28 on: November 13, 2009, 01:40:23 AM »

It's been two weeks.  Are you going to begin coding that Willy?  I think it sounds great, and I loved what you did with Grizly Gulch. 

I'm in need of motivation to return to my project.  I totally hit a wall with my damned poison effect... I don't know how setting texture stages is supposed to work.  I am almost getting the effect I want, but the way that it is failing tells me that I am definitely missing something on a fundamental level.  It's sad, because what little I know about blending tells me that it is exactly what I need to do almost everything I'd ever want to do...

We should eventually collaborate.  I'm going to post what I have soon, just so you all can see what level of quality I'm working with.  Sadly, if I can't get this texture blending stuff to work exactly how I want it to, there will be nothing to brag about as my program will then only be showing off my spritework rather than any actual graphical programming action.
Logged

If you re-spec your elduhz and own a Vita - http://twitter.com/BSNursery
MeshGearFox
Posts: 8693


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #29 on: November 18, 2009, 01:19:42 AM »

I decided to get off my ass, learn SDL, and try to make a seven day roguelike, which will probably take longer than seven days and it's Boolean RPG, which isn't really a roguelike.

So far I have movement and sprites working. Not happy with the movement code though.
Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

Pages: 1 [2] 3 Print 
« previous next »
Jump to:  



Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!