Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Http connection is delaying canvas.keypressed  (Read 4965 times)
0 Members and 1 Guest are viewing this topic.
Offline Hooble

Junior Newbie




I love YaBB 1G - SP1!


« Posted 2007-05-18 15:38:57 »

Hello all!

I havn't been back here for quite some time, but I have one that is stumping me for the moment. My name is Adam Schmelzle, and I have been making J2ME games for a while(Attack Chopper 1/2, Attack Breaker Pro, Attack Brain), so I'm not really new to this.

I am working on an online system for my next game, and all my messaging is done through an HttpConnection for now. I am trying to make this compatible with Midp1.0, which is why I am using http. I have everything working fine on the Sun WTK25, but when it comes to using my phones, I run into problems with my canvas.keypressd() events.

Sometimes the keypresses/releases will work fine, sometimes a delay of a second or two, sometimes it won't fire until I hit some buttons a few times.

Example 1: So I can press and hold "up", get the "up-pressed" event, wait a couple seconds then release, but not get the "up-release" event. If I press "up" again I don't get the "up-pressed" event at all, but when I release I finally get the original "up-release" from the first keypress.

Example 2: Press "up", get "up-pressed" event. Release "up", and never get the "released-up" event at all.

This only happens if my network IO thread is sending/receiving data. On one of my phones I experience problems for the entire duration of my game after even doing just 1 httpConnection on the main game thread.

I guess I want to know if anybody has some advice for me regarding network IO. I assume that somewhere along the line the runtime is starving the thread that handles the keypresses, but is there any way to avoid this? Maybe sleeping/waiting briefly(1ms) in the middle of transfering data every once in a while? It does take a second or two to send/recieve.

I plan on implementing socket IO for Midp2.0 phones after I've got all the kinks worked out for Midp1.0. My server will use nio, which I have used before in an applet game with positive results.

Help please,
Adam.
Offline OverKill

Junior Member




Java games rock!


« Reply #1 - Posted 2007-05-21 09:53:37 »

Are you not using a thread to handle your network connections?
Making a connection is the most time-consuming part.

Also writing a realtime.multiplayer game for mobile might not be the best idea, nothing personal.
Seeing the problems we have with our messaging client, I would not go down that path.
A TBS or similar game would be a different issue.

Though I'd love to be proven wrong.
Offline Hooble

Junior Newbie




I love YaBB 1G - SP1!


« Reply #2 - Posted 2007-05-22 15:15:36 »

Thanks for the reply! I was looking at the timestamps on the most recent posts, and getting discouraged. I'm not doing anything that's obviously completely silly.

From my own post:
1. Of course I'm using a separate thread for IO, QUOTE: "This only happens if my network I/O thread is sending/receiving data." You don't honestly think somebody that has made even 1 game doesn't know how to handle I/O?
2. I didn't say "real-time" anywhere. I've got a 2+sec ping.

With that cleared up, here's an update: It's not my fault. That's right; I purchased a new phone, and it passed with flying colours. Not only that but I 'hacked' one of my other phones to remove the 'network access allowed?' screen, and the problem magically went away.

So here's what I think was happening: After the phone's stupid OS pops up the 'network allowed?' screen, it never cleans up after itself properly, and buggers up the keypresses. Since to solve my problem the only thing I did was remove this screen, it's the obvious culprit. There's always something wacky when it comes to mobiles.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline OverKill

Junior Member




Java games rock!


« Reply #3 - Posted 2007-05-22 15:50:57 »

Don't take is personally, without the info I have to guess and, well you know the 'I wanna make an MMO on my mobile' types Wink
And the line you re-quoted hinted at sending data each keypress.

And yes, it is your fault. /me jumps behind a large rock Wink

Ah the permissions and the security system. The royal PITA!
If you want to never see those again you would have to set all permissions (watch out, can have device specific issue) and sign your midlet.
Just setting the permissions lets you get to 'Ask first time', signing gets you the 'never ask me again':

In the WTK you can set your midelt to manufacturer and it will never ask you.

Quote
There's always something wacky when it comes to mobiles.
QFT!
And that is why we earn a lot of money for doing this.
Offline Hooble

Junior Newbie




I love YaBB 1G - SP1!


« Reply #4 - Posted 2007-05-22 18:24:16 »

Well I still contend that it's "not my fault", since it's not the permissions that cause the problem, but the 'popup ' screen that is doing the asking. The security question is there to ask the user about allowing the connection, not delaying the keypresses in strange and unpredictable ways.

Chosing "always allow" doesn't fix the problem with the keypresses, it just lets my connection have permission. Heck, on one phone it asks "always allow" for every connection regardless of the user chosing "yes". The keypresses are screwy because of the question, not the answer. One of my phones asks permission for every single midi note, no joke.

I can't sign the apps. I upload them to my advertiser, who in turn ads their advertising code to the app, and then distributes it for free from their site and others. If anyone is going to sign it it'd have to be them, but because this isn't limited to specific manufacturers/cariers/regions/countries/languages/continents, it's not really practical.

"And that is why we earn a lot of money for doing this.", I'm not quite in the "lot of money" category yet myself.

*shameless plug* Check out http://gamejump.com , my games are actually some of the top ad-revenue generating free games out there. It's nice to pay the bills while working from home.

Offline OverKill

Junior Member




Java games rock!


« Reply #5 - Posted 2007-05-23 10:23:13 »

We have the permissions and the signing and there are no problems on our side.
Might be a firmware issue? What phone is this?

@Signing:
Ah ok, that changes a lot. I have been down that road.

@Money:
Where are you located? I might have something.

@Plug:
Which ones are yours? I can see my last project from my old comp there as well.
Offline Hooble

Junior Newbie




I love YaBB 1G - SP1!


« Reply #6 - Posted 2007-05-23 14:35:42 »

My games are these:

Attack Breaker Pro:
http://www.gamejump.com/gj/jsp/details.jsp?id=315

3D Attack Chopper:
http://www.gamejump.com/gj/jsp/details.jsp?id=127

3D Attack Chopper 2:
http://www.gamejump.com/gj/jsp/details.jsp?id=311

The listings are all done by  (#times played) / (#players) for the current month. Currently my best performing game "Attack Breaker Pro" is at #9 in the "Action" category, and #1 for the "puzzle" category  for the whole catalog. Actually it's under-ranked at the moment, 'cause I advertised it a whole bunch at the start of the month which brought up the (#downloads) significantly thus moving my rank lower until the (#plays) evens out again from all the new players. By this time next week, I'll be back in the overall top 10 list.

AC1 is currently the most downloaded game on getjar.com, and is at  #58 in the "Action" category. It's been that way for a couple months. AC2 doesn't do nearly as well as AC1, though I like it better, and it's still new

I have another game: "Attack Brain":
http://www.gamejump.com/gj/jsp/details.jsp?id=571
, but that was more of a side project I did to show a friend how to make mobile games. His favorite board game is "mastermind", so we re-made it.

I live in London, Ontario Canada. I'm not really looking for a better paying job, since I've only been doing the ad-game thing since September, and I can already bring in enough money to work from home and still pay the bills. Every game I put out brings in more money, so unless I see an amazing job I'm not likely to be enticed.
Offline OverKill

Junior Member




Java games rock!


« Reply #7 - Posted 2007-05-23 15:23:30 »

nice. Attack Chopter looks like a game for me. Smiley

For the life of me I cannot figure out to get the listing. Or are the categories done this way?
Funky Monkey was my last project at HandyGames.

Unfortunetly Canada is slightly off the map for people we are looking for.
Offline Hooble

Junior Newbie




I love YaBB 1G - SP1!


« Reply #8 - Posted 2007-05-24 02:35:51 »

The listings arn't numbered on the site. They are however completely ordered from left->right, top->bottom. #1 in top-left, #2,3, on top row, 4,5,6 next row etc..

This is a recent development. They only started ordering all the listings within the categories this way a month or so ago. Up until then they didn't have an automated way to rank the games. So any category you pick will have all the games listed in order, just not numbered.

I'd love to hear some feedback from a developer on any of my games. Please come and post on my messageboard:

http://attackgames.proboards84.com

I'm always updating it with my current progress, and asking for input from players, though it's a bit difficult getting others to post .
Offline OverKill

Junior Member




Java games rock!


« Reply #9 - Posted 2007-05-24 12:11:51 »

@People not commenting:
Might be because there is a problem with the registration.
I get a "It appears that you attempted to register for this forum using the wrong form. Please use the form below to register."

MIght have some ideas for future games.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hooble

Junior Newbie




I love YaBB 1G - SP1!


« Reply #10 - Posted 2007-05-24 19:29:32 »

I had no idea that there might have been a problem with registration. Thanks for pointing that out. Unfortunately it's a free board (ProBoards), and I can't really fix any problems that pop up beyond the admin settings.

*EDIT* I had a go at creating a new user, and didn't have any trouble. Hmm, very puzzling.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

ctomni231 (36 views)
2014-07-18 06:55:21

Zero Volt (34 views)
2014-07-17 23:47:54

danieldean (27 views)
2014-07-17 23:41:23

MustardPeter (30 views)
2014-07-16 23:30:00

Cero (44 views)
2014-07-16 00:42:17

Riven (46 views)
2014-07-14 18:02:53

OpenGLShaders (35 views)
2014-07-14 16:23:47

Riven (35 views)
2014-07-14 11:51:35

quew8 (31 views)
2014-07-13 13:57:52

SHC (67 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!