GPWiki.org
GPWiki.org
It is currently Wed May 22, 2013 7:48 am

All times are UTC




Post new topic Reply to topic  [ 112 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject:
PostPosted: Tue Mar 31, 2009 9:28 pm 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
Jasmine wrote:
You mean name tags above the character's heads?

I'd initialize them when they first come on screen should they not have a name tag already assigned.

And delete the tags only when you need the tag space for another character that has come on screen.


Right, So, lets say the avg name space is 10Hx50W pixels and you got 300 users on one map, thats a rect 3000x15000 right?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 10:37 pm 
Funky Monkey

Joined: Mon Aug 16, 2004 2:48 pm
Posts: 1604
Location: Minneapolis, MN USA
neruos wrote:
Right, So, lets say the avg name space is 10Hx50W pixels and you got 300 users on one map, thats a rect 3000x15000 right?


Nope ... if you want to hold all of the names on a single bitmap, it would be 3000 x 50.

Or, if you go 5-names-wide, then it would be 600x250. :)

-Bryk

_________________
www.mwgames.com ... Dicey Curves, Space Mission, Jump Gate, Gem Raider, DareBase, Castle Danger, Keeps & Moats Chess


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 11:13 pm 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
Oh duh, complete brain fart on the math. LOL.

On the FPS note, I'm starting to get worried. I've added 4 windows, 1 chat window, the quickslot and the playerbar (mp/hp) and with all those open, I'm getting close to 99/100FPS. It seems to be taking about 40FPS per item I add.

What happens when the gui is eatting 60FPS and no content at all, like characters, monsters, spell effects, weather and all the animation. Should I be worried yet? I don't know if this is a issue yet, or if this is just the limits of what vb6 and DX7 can do, I would like to finish first and then upgrade that when I have a good understanding of game dev.

I've posted some screenies the GUI so far, I still have quite a few more GUI elements to add including the finished windows and all the child controls.

Open:
http://img256.imageshack.us/img256/3157/open.jpg

Closed:
http://img148.imageshack.us/img148/8267/closexyp.jpg

My Current Logic for loading and handling the graphic data is.

Define the Surface object, load the graphic into the surface object, pull from the surface object the graphic I want, draw that where I want on the buffer, and then update the primary screen.

Is there anything else I'm missing? Also, none of my graphics are powers of 2 in size, so most surfaces are setup like 400x600 or 200x50, etc. Does that make a difference?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 01, 2009 12:59 am 
Technomaniac
User avatar

Joined: Mon Aug 23, 2004 12:24 am
Posts: 3096
Location: Washington , USA
Like I said earlier, you really should stop judging performance off FPS, it's not accurate.

Grab a profiler or make a utility, and time sections of code and figure out what your slowest procedure is. You can't optimize by guessing :)

_________________
GMan
Black Ninja Games
Imagine ASCII art here!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 01, 2009 1:05 am 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
GMan wrote:
Like I said earlier, you really should stop judging performance off FPS, it's not accurate.

Grab a profiler or make a utility, and time sections of code and figure out what your slowest procedure is. You can't optimize by guessing :)


I think I'll add a quick sprite animation function that can draw say 200 64x64 objects and see how the Gui handles up.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 01, 2009 2:07 am 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
Ok, so I added the simple sprite placement and with 60 frames of animation. I didn't placement all that great, but I just wanted to test it with 300 objects. I was surprised when it ran at the current FPS with all windows open.

http://img24.imageshack.us/img24/654/300render.jpg


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 02, 2009 2:37 am 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
I thought I would post a screenie of the current GUI to date. I've finished most of the graphic design on the GUI with just the windows and various other areas not completed. The Playerbar (hp/mp/level/class) and the Menubar (player stats, equipment, items, skills/spells, options, menu) are both fully functional. The quickslot is functional in the show and hide and the related key assoication, but not the drag n drop of items to it yet.

The character object is that little square showing off transparency, the map is well, from zelda and is only for testing purposes, it is scaled up to match the scale at which I require. The map you're seeing is 2048x2048 pixels in size and is fully loaded with smooth transitioning.

The FPS is acceptible thus far, again, just showing the capibilities of VB6 and DX7. I am disappointed that DX7 does not include alpha-blend and that reason alone will be the edge to upgrade to DX8 or 9. I do know of the dll for DX7 to add alpha-blend functionality, but I do not like depending on someone elses code and in the future I will most likely wont be able to include such a item.

http://img15.imageshack.us/img15/4655/newqck.jpg


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 02, 2009 6:13 am 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
After going thru the process of adding GUI elements, I've started thinking about 2 windows that will make use of alot of child controls. The dreaded Menu Window and Options Window.

The options window is the one I'm really dreading to tackle as far as writing the entire GUI aspect of this window along with all the controls. This pushed me to look into the FlipToGDISurface function. I played around with this function and was able to create an function that allowed me to switch between the game engine and into a fullscreen model window, with full access to all the window controls I wanted.

The problem that I have now is, well, I stop rendering and hide the game window in order to successfully show my GDI window, I keep the same resolution also. But, users can now alt+tab from this GDI window into their windows desktop, but, once they return via alt+tab, the game window is active, not the GDI window, which requires more code to keep track of the entire process.

Although it seems easy, it really feels disconnected and unreliable at worst, which can happen from time to time. I believe I will ditch this method and go back to creating the GUI element classes in render instead. I also tested the GDI window example that comes with the Directx7 SDK (its in C++), once ported to VB, it functioned ok, but requires handling DCs and flipping to the GDI to grab bitmap data, converting it over and displaying onto the directx surface.

That method was just buggy too.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 4:32 am 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
Ah, Jas, I had fixed the mouse dragging feature (where if you drag to fast, you lose the window) with the ptinrect function, but now that I've changed all the code over to class and directx, it detaches and I can't figure out how to lock the cursor to the original click point. I will play around with it later, but if you got an idea, I'm open to anything. :D


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 5:19 am 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
Ok, How do you all handle your keypresses. I'm running mine in a loop and assigning a delay speed for keypresses. Is there a better way to limit or delay keypresses ? Like, say for textbox entry, so that if you press "A" it doesn't loop 1000 times. :D


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 4:51 pm 
Mumbo Jumbo
User avatar

Joined: Fri Aug 20, 2004 1:15 pm
Posts: 804
Location: Michigan, USA
for key presses, this is what i do: (its in VB)

Code:
dim KeyPressedBool(255) as Boolean
public Function KeyPressed_Once(byval Keycode as Integer) as Boolean
    If KeyboardState.Item(keycode) = True Then
        If KeyPressedBool(Keycode) = False Then
            KeyPressedBool(Keycode) = True
            Return True
        Else
            Return False
        End If
    Else
        If KeyPressedBool(Keycode) = True Then
            KeyPressedBool(Keycode) = False
        End If
    End If
    Return False
End Function

_________________
The path to hell is paved with clever code.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 6:20 pm 
Corpse Bride
User avatar

Joined: Tue Jul 01, 2008 11:44 pm
Posts: 2216
Location: England
Is this keyboard input event driven or queried in the game loop?


Quote:
I've changed all the code over to class and directx, it detaches and I can't figure out how to lock the cursor to the original click point.


I don't know enough about what you've done to give advice, but I don't think the solution it's any different: Whether you're using an array to define rectangles, or you're building rectangle classes, you'll need to maintain (use) an array (list) for zorder sorting.

I personally find classes to cause more headaches than they cure. I prefer lower level data structures. But that's just me :)

_________________
I ain't pushing no moon buttons.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 6:36 pm 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
Jasmine wrote:
Is this keyboard input event driven or queried in the game loop?

Quote:
I've changed all the code over to class and directx, it detaches and I can't figure out how to lock the cursor to the original click point.


I don't know enough about what you've done to give advice, but I don't think the solution it's any different: Whether you're using an array to define rectangles, or you're building rectangle classes, you'll need to maintain (use) an array (list) for zorder sorting.

I personally find classes to cause more headaches than they cure. I prefer lower level data structures. But that's just me :)


Yes, I'm doing exactly what you suggested and its very clean and fully functional, the problem is when I grab the window and shake the mouse really fast, if its near the edge the window drops off the drag. :D I haven't revisited this as I moved on to adding the child object stuffs, but I don't want to forget about it.

I have 2 keyboard events I'm running right now (polling the dinput for all ingame functions) and the forms keydown event for testing. The forms keydown event automaticly has the keypress delay/repeat? (based on my windows settings). I want to add this to the polling dinput event class.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 6:42 pm 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
Moglor wrote:
for key presses, this is what i do: (its in VB)

Code:
dim KeyPressedBool(255) as Boolean
public Function KeyPressed_Once(byval Keycode as Integer) as Boolean
    If KeyboardState.Item(keycode) = True Then
        If KeyPressedBool(Keycode) = False Then
            KeyPressedBool(Keycode) = True
            Return True
        Else
            Return False
        End If
    Else
        If KeyPressedBool(Keycode) = True Then
            KeyPressedBool(Keycode) = False
        End If
    End If
    Return False
End Function


Hmm, how would you assign a speed to that? I believe I'm going to have to add a timerclass that counts ms's passed.

Press attack button (attack takes place), delay until next attack allowed or if press attack and hold, follow thru with double attack, delay, double attack, delay, etc...

or Press spell key, but spell is a charging spell (think of zelda - a link to the past, when you can charge up your sword and do a spin attack), but if you press the key back to back without holding, you get the above attack.

I think that's accomplished by using some type of timer function.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 7:15 pm 
Corpse Bride
User avatar

Joined: Tue Jul 01, 2008 11:44 pm
Posts: 2216
Location: England
you mean you want a timer for each key, since it was depressed?

I would use a single timer and calculate delta-time with it. WindowsAPI provides it's own getticks function, so you could use that.

There's various ways to do this.

You could create an array keytimers(255) to remember the time state of each key.
  • You could set an entry negative to mean key is up.
  • You could set an entry to zero to represent the key going down.
  • For keys which are down (keytimer()>=0) you add delta-time to that keytimer.
  • If a key goes up, you set keytimer() = negative, to deactivate it.
  • To retrigger a key timer, you set keytimer() = 0, which you could use for simulating key-repeat.


That would work with a key querying system, or an event based system, but is probably not the best way for either. :)

_________________
I ain't pushing no moon buttons.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 7:28 pm 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
I use both the windows API gettick and the Directx gettick for my timebased stuff, I think you're right about the timers.
Code:
Const MaxTimers = 50

Public Type TimersConfig
 Start as Integer 'time start in ms
 End as Intefer 'time end in ms
 Enabled as Boolean 'during the time start and time end, enabled
End Type

Public Timers(MaxTimers) as TimersConfig

Public Function UpdateTimers()
'cycle thru all the timers, updating the enabled based on start/end
End Function

'add this to your TimeElapsed/GetTickCount function
UpdateTimers


Now, anytime I want to add a delay to a key, I just assign a timer to it. There is more I'm missing but this is what I was thinking.[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 7:54 pm 
Ankle Nibbler

Joined: Sun Mar 22, 2009 10:55 pm
Posts: 130
I thought I would give another update shot. :D

http://img13.imageshack.us/img13/9646/s ... tscopy.jpg


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 8:14 pm 
Corpse Bride
User avatar

Joined: Tue Jul 01, 2008 11:44 pm
Posts: 2216
Location: England
yes, that's coming along nicely :)

I'm sure I've seen that tile-set before somewhere.. Is it a public-domain one?

Also if you don't mind me saying, from an appearance point of view, the tile-set looks too low contrast compared to the GUI. I think it would look better if you increase the contrast of the terrain a little. :)

_________________
I ain't pushing no moon buttons.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 8:46 pm 
Technomaniac
User avatar

Joined: Mon Aug 23, 2004 12:24 am
Posts: 3096
Location: Washington , USA
I think it's from RPGMaker. But the GUI looks good. :)

_________________
GMan
Black Ninja Games
Imagine ASCII art here!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 9:50 pm 
Corpse Bride
User avatar

Joined: Tue Jul 01, 2008 11:44 pm
Posts: 2216
Location: England
GMan wrote:
I think it's from RPGMaker. But the GUI looks good. :)


http://blogdematt.kouryu.info/article-3 ... mages.html

:)

_________________
I ain't pushing no moon buttons.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 112 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group