State of Profit

What happens on a power interruption? Would you lose everything since the time the process was started?

I don’t do that for the reason that I want everyone’s bus to start with 1 and go upwards without having one table per person. The table with all the vehicles in it is using auto increment and the vehicles use the id when talking to the server so the server knows which vehicle is which.

Some things are updated constantly (owners of land, content built, vehicles bought). Some things are updated every 30 minutes and at server shutdown (normal shutdown) like money and camera positions.

Also, I’ll reset the server tonight (in about 4 hours) instead of tomorrow morning, as tomorrow afternoon I won’t be able to use internet very easily in case something goes wrong.

Mike

I’m sorry for bumping my own thread (I try to always edit the last post) but this deserved a new post.

I got a message from one of our great forum members and I thought I’d share the question and the answer.

When I developed the game (and nowadays when I’m developing/testing) I do everything on my laptop.

Once I realized that the game idea was worth pursuing and the game was good enough to continue developing I decided to rent a server to test everything from lag to having it run 24x7 without crashing. I started looking for something cheap with quite a bit of RAM (preferably in Europe so I have a quick connection to it). I came to a big US provider that had some bad rumors in the US but the EU servers aren’t as full yet, godaddy. I ended up paying something like 20 euro per month for a VPS (shared server, something like an image on a VMWare server) windows 2008r2 server (I didn’t want to learn linux as well as I already was busy with learning java…) with 2gb of ram and a very nice broadband connection.

When I had the server I installed xampp to get apache, php, mysql and ftp.

To be able to run the java server constantly I used a wrapper to run the java executable jar as a windows service (starts up with windows): http://wrapper.tanukisoftware.com/. It took a couple of hours to figure out but the documentation is fine and it’s not very hard once you RTFM.

As I had (have) some problems with server dead locks I currently run the server in debug mode in eclipse, but hopefully that’s only temporary. The service is still on automatic though so if the server would crash/reboot the service would kick in and the game would continue.

I hope it answered the question and if anyone wants to know any more about the game and the technology please ask and I’ll try to be an open book :slight_smile:

Kind regards,
Mike

EDIT:

Thanks for the stacktrace, fixed it :slight_smile:

Does anyone know why my stacktrace sending to server sometimes says that the stacktrace is “0” (it mostly works though…):


    public void submitError(final Throwable t) {
        final long currentTime = System.currentTimeMillis();
        if (currentTime - lastSentError > 30000) {
            lastSentError = currentTime;
            final StringWriter writer = new StringWriter(1024);
            t.printStackTrace(new PrintWriter(writer));
            sendAsyncMessage("stackTrace " + writer.toString().trim());
        }
    }

hey, is there a reason that when I built a road it didnt appear on the map when I zoomed out? does it just take some time to be added?

I think this is a pretty important issue: it means there is a bug in your network-protocol. (99% sure)

The map gets created on the server once every 20 minutes, at the moment the client only gets the newest version when it starts up (It’ll be changed to every 20 minutes tonight/tomorrow). Thanks for testing it :slight_smile:

I dislike your answer as I have no idea how to troubleshoot that :stuck_out_tongue: How come it sometimes work and sometimes not? There is no reason why the above function could return a “0” instead of the stacktrace?

Mike

No.

Humm… the word “stacktrace” and the space comes through correctly and I never saw this kind of missing information in any other call. Maybe it’s the gzipping that somehow distorts it.

this is just a thought, and probably for hte distant future, butthis should be a facebook app… cuase it just seems so time-wasting that it belongs on facebook :slight_smile:

Also on a feedback note. wheneve rI buy a new bus it says "cannot find a path’ but then after a few seconds, it goes anyways?

Maybe maybe maybe (maybe?) your obfuscator ruins the stacktrace?

No more new buses for me :’(

java.lang.NumberFormatException: For input string: "1813125442255371312553892265"
	at java.lang.NumberFormatException.forInputString(Unknown Source)
	at java.lang.Long.parseLong(Unknown Source)
	at java.lang.Long.parseLong(Unknown Source)
	at com.stateofprofit.client.m.d.ah(Unknown Source)
	at com.stateofprofit.client.a.a.a(Unknown Source)
	at com.stateofprofit.client.a.a.a(Unknown Source)
	at com.stateofprofit.client.a.h.af(Unknown Source)
	at com.stateofprofit.client.o.d.a(Unknown Source)
	at com.stateofprofit.client.a.b.a(Unknown Source)
	at com.stateofprofit.client.a.g.a(Unknown Source)
	at com.stateofprofit.client.b.c.a(Unknown Source)
	at com.stateofprofit.client.b.c.run(Unknown Source)

Yes, that’s the same problem I’m having. You just have to wait for the world-reset.

why when I clicked on my station to choose it, it says “choose another station”. Am I only allowed a certain number of buses per station

I noticed the same regarding “Cannot find path”, apparently I put path to null sometime (meaning that it thinks it cannot find it). I’ll look into it later.

I might, might, might, have a basic version of reputation in the game at the reset (no more stealing roads without consequence).

Regarding facebook: If I cannot get enough visibility of the game by myself I’ve considered walking that path :slight_smile:

Riven: I really hope it’s the obfuscator… I’ll maybe print something else along as well to make sure it works.

Kind regards,
Mike

The server is reset! You can still use your old accounts.

New feature, reputation! You cannot see your reputation with cities yet but it goes something like this:

The first player to build a station in a city gets 200 reputation, everyone else gets 100 reputation. Based upon your reputation and number of houses you have close to your station, you’ll get a percentage of the total city passengers.

In other words: Don’t steal people’s cities unless you’re fine with getting less citizens than them. There will be more ways in the future to get/loose reputation, but I’ll post the updates like I always do :slight_smile:

Zooming in from the map now generates less “clouds” while loading
No more vehicles with weird numbers blocking you from buying more
Map is 4 times the size
You start with 200.000 instead of 150.000
Money generated from buses is halved (people ended up with millions they couldn’t spend :P)
People come more quickly to your stations (you might need 3 buses per station to start with instead of 2)
Also some general bug fixes on the server side

New way to receive passengers: the passengers of a city is shared over the stations. Stations belonging to players with more reputation or stations with more houses within 4 squares gain a bigger part of the passengers given out from a city.

You set the destination station to the same as the starting station :stuck_out_tongue:

Kind regards,
Mike

hahah, apo’s reign is over!

also, could u add selling stations, cuase I accidentally put 2 in one town… yes, I know dumb moment…

Yes! :slight_smile:

You can remove it by bulldozing it… but it’ll cost you 4000 to remove it :stuck_out_tongue: (Later the stations will have a maintenance cost connected to them, and then it’ll actually make sense to remove them).

Also, I just remembered a bug with the path finding system and I’d advice you against placing intersections directly after bridges/tunnels… :wink:

Mike

I have one issue to report:

If you have a central town with 4 towns connecting to it, and you have 4 buses, they will clog up the central town.

The reason is simple: buses will only leave when they are full. The 4 remote towns are filling up (>300 passengers) while the central town fills the buses one by one, and is always nearly empty.

Solution: make the buses leave after N seconds, so they leave while not being full, and can pick up the passengers at the other town, to make lots more money that now (idling in an empty station).

That’s the next thing I’ll add, I’ve been having it on the todo list for quite some time but other things have been more important.

Vehicles will default on “load” (ie, leave after 20 seconds and just grab what you can) but will be able to change them to “full load” (ie, as it is now).

Mike

hey, can u add a way to zoom wihtout scrollwheel?