The Moosader Community

Visit the IRC at irc.freenode.net #Moosader! Community dedicated to programming and game development! Moosader.com
It is currently Thu Nov 14, 2019 1:24 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: PoS code audit
PostPosted: Sun Jun 12, 2011 6:57 pm 
Offline
Site Admin
User avatar

Joined: Wed May 14, 2008 4:43 am
Posts: 2328
Location: Kansas City
I'm doing an inspection of all the PoS code in the current project; for some reason, the game runs really freaking slow in my Ubuntu VM, and it CAN'T be all the VM because I have a 3D SFML/OpenGL project that runs smoothly under the VM.

So I'll write down notes as I step through.

I've gone through and set everybody to "Inactive" on the contributor list:
http://code.google.com/p/pickin-open-sticks/people/list

If anyone is interested in working on this project more, let me know.


Code Style

I don't like "Java-style bracketing"; ie
Code:
void Main() {
  // stuff
}

I'd prefer braces to be on separate lines:
Code:
void Main()
{
  // stuff
}

_________________
Android apps by Moosader! - Open Source projects - Moosader.com


Top
 Profile  
 
 Post subject: Re: PoS code audit
PostPosted: Sun Jun 12, 2011 7:35 pm 
Offline
Site Admin
User avatar

Joined: Wed May 14, 2008 4:43 am
Posts: 2328
Location: Kansas City
The game itself

The game itself is pretty unrefined; The GUI elements I'm seeing are pretty ugly... white text on off-white background, completely square and flat-colored.
Exit button randomly placed on the game field.

The stick seems to have some extra color to it, don't know why that is.

Image

_________________
Android apps by Moosader! - Open Source projects - Moosader.com


Top
 Profile  
 
 Post subject: Re: PoS code audit
PostPosted: Sun Jun 12, 2011 8:32 pm 
Offline
Site Admin
User avatar

Joined: Wed May 14, 2008 4:43 am
Posts: 2328
Location: Kansas City
Main

There is way too much stuff in main - The GUI stuff shouldn't be set up in there, and the GUI stuff is about 36 lines of code inside of main.

Inside the game loop, in the Game State switch,
Code:
mainWidget.Hide();
mainPlayWidget.Show();

Doesn't need to be ran every time, I assume.

Once the
Code:
map.Render(system);

is removed from the game loop, everything runs quickly.

_________________
Android apps by Moosader! - Open Source projects - Moosader.com


Top
 Profile  
 
 Post subject: Re: PoS code audit
PostPosted: Sun Jun 12, 2011 8:34 pm 
Offline
Site Admin
User avatar

Joined: Wed May 14, 2008 4:43 am
Posts: 2328
Location: Kansas City
Map

"Initialize" is misspelled.

Map::Render is being passed System&; it does NOT need the entire class!!

I tried rewriting the render function but I can't get it to speed up; I'm finding it odd that there are various things I can run in my ubuntu vm, and yet it can't render 19x25 tiles.


WIP

_________________
Android apps by Moosader! - Open Source projects - Moosader.com


Top
 Profile  
 
 Post subject: Re: PoS code audit
PostPosted: Sun Jun 12, 2011 8:52 pm 
Offline
Site Admin
User avatar

Joined: Wed May 14, 2008 4:43 am
Posts: 2328
Location: Kansas City
UI

I don't think I have time to step through the UI code tonight, but here's what I'm gathering, purely from looking at the files:

There are a lot of files. I think at this point, there are too many files for the point that Pickin' Open Sticks is at.

If we're going to integrate a sophisticated GUI into Pickin' Open Sticks, it should be developed outside of PoS and brought in later, either through importing the code or via dll.


For the time being, we might remove the UI code, if Sutabi sees fit.
I think it's partially getting in the way, because there's so much, and it will scare any new contributors away (too much to grok with, having to learn). Plus, it's quite complex and implemented before we set up any standards for branching or code writing standards.
I'd like to have a more functional and better looking UI developed before committing something partially written.

I do like that they're in their own namespaces.

_________________
Android apps by Moosader! - Open Source projects - Moosader.com


Top
 Profile  
 
 Post subject: Re: PoS code audit
PostPosted: Mon Jun 13, 2011 1:24 am 
Offline
Smushed Goomba
Smushed Goomba

Joined: Tue May 24, 2011 3:52 am
Posts: 14
Location: California
I've added a simple FPS count in the console, be interested on the frame rate.

Here is my netbook specs
Intel Atom N270 1.6 GHz Processor
512 KB L2 Cache, 533 MHz Front Bus speed
1024 MB DDR2 (PC2-4200) RAM
120 GB (5400 RPM) SATA Hard Drive
Intel GMA 950 graphics accelerator

The GMA has a 400Mhz processor and given that this game eats up 100% of my netbook's cpu I would say we are not using opengl very well. It would be better to use display lists, vertex buffers objects, vertex arrays

* I get about 24-30 FPS on my netbook.
* I created a clone and used a display list and get 30-60 FPS: http://code.google.com/r/sutabi-pickin-open-sticks/


Top
 Profile  
 
 Post subject: Re: PoS code audit
PostPosted: Mon Jun 13, 2011 3:10 pm 
Offline
Smushed Goomba
Smushed Goomba

Joined: Tue May 24, 2011 3:52 am
Posts: 14
Location: California
So I ran it on my quad core work computer which should had mad this run like cake, but instead for 10 FPS.... So I disabled Unity from 11.04 and got 60 FPS. Are you running Unity with your Ubuntu VM setup?


Top
 Profile  
 
 Post subject: Re: PoS code audit
PostPosted: Mon Jun 13, 2011 3:19 pm 
Offline
Site Admin
User avatar

Joined: Wed May 14, 2008 4:43 am
Posts: 2328
Location: Kansas City
sutabi wrote:
So I ran it on my quad core work computer which should had mad this run like cake, but instead for 10 FPS.... So I disabled Unity from 11.04 and got 60 FPS. Are you running Unity with your Ubuntu VM setup?


I'm running Ubuntu 10.10... That, or Ubuntu 11.04 w/ Gnome (or "Classic"?) I'll check when I get home, if I have time to tonight.

_________________
Android apps by Moosader! - Open Source projects - Moosader.com


Top
 Profile  
 
 Post subject: Re: PoS code audit
PostPosted: Tue Jun 14, 2011 4:45 am 
Offline
Goblin
Goblin

Joined: Tue May 04, 2010 2:01 pm
Posts: 112
Moosader wrote:
UI

I don't think I have time to step through the UI code tonight, but here's what I'm gathering, purely from looking at the files:

There are a lot of files. I think at this point, there are too many files for the point that Pickin' Open Sticks is at.

If we're going to integrate a sophisticated GUI into Pickin' Open Sticks, it should be developed outside of PoS and brought in later, either through importing the code or via dll.


For the time being, we might remove the UI code, if Sutabi sees fit.
I think it's partially getting in the way, because there's so much, and it will scare any new contributors away (too much to grok with, having to learn). Plus, it's quite complex and implemented before we set up any standards for branching or code writing standards.
I'd like to have a more functional and better looking UI developed before committing something partially written.

I do like that they're in their own namespaces.

Yeah.. sorry that's the old gui, I haven't updated the PoS gui code. Now it's in a static library, and the ui is initialized from an .xml file... so it's cleaner :D.
I'll take care of that when I have some time.


Top
 Profile  
 
 Post subject: Re: PoS code audit
PostPosted: Fri Nov 18, 2011 11:34 am 
Offline
Site Admin
User avatar

Joined: Wed May 14, 2008 4:43 am
Posts: 2328
Location: Kansas City
I'm actively refactoring the code right now.
Also, it was stupid of me to post PoS documentation in Google Docs and the forum rather than on the project page itself:
http://code.google.com/p/pickin-open-sticks/w/list

I have not yet merged the branch, I'm working on a refactor branch:
http://code.google.com/p/pickin-open-sticks/source/list?name=RefactoringPoS


I am refactoring it because of my Google Code projects, PoS gets looked at the most.
Page visits over the past year:
PoS: 2,342
Sader: 1,199
Farmer Duel: 757

So yeah, I'd rather the code be well structured and easily maintained and updated.

_________________
Android apps by Moosader! - Open Source projects - Moosader.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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
You cannot post attachments in this forum

Search for:
Jump to: