-
Posts
3,655 -
Joined
-
Last visited
-
Days Won
12
Content Type
Profiles
Forums
Events
Everything posted by a_bertrand
-
[ NEW ] MyGGworld Topsite Offers 30day premium
a_bertrand replied to myggworld's topic in Advertising offers
Ok, so your starts are all wrong as basically any bot will count as click too... very good... -
The layout is broken for sure... Or at least it doesn't work on FF... And seems pretty much standard McCode beside the layout which doesn't work.
-
Converter helper tool - From V2 to NWE
a_bertrand replied to a_bertrand's topic in New Worlds Engine
Well tell me what it removed, as it's certainly some bug on my side. It should not break too much your code ;) -
Some of you was looking for a tutorial how to convert McCode V2 mods to NWE. I thought, maybe it is possible to at least partially help the conversion, therefore I started to write down a little tool to help you guys. It will not produce a good NWE mod and I would say that most of the time the conversion made by the tool will not work, yet it helps for the first and most annoying steps like changing all the $db->query into $db->Execute and such. The project is pretty much experimental, and may very well be improved over time, yet it's a start point: http://www.nw-engine.com/index.php?c=mc2_converter So what is supported: - $userid => $userID - $ir['something'] => $userStats['something']->value - removes the include of global.php - removes the $h->endpage - mysql_query('something') => $db->Execute('something') - $db->query('something') => $db->Execute('something') - mysql_insert_id => $db->LastId() - mysql_num_rows($q) => $q->NbRows - $db->num_rows($q) => $q->NbRows - item_add(...) => Item::InventoryAdd(...) - item_remove(...) => Item::IventoryRemove(...) - event_add(...) => SotrePersonalLog(...) - Adds the Translate function around the echo and print strings. So, for the time being, that's what it does. More functions can be added and things like get_rank can be either implemented as additional function automatically added to the converted code or an equivalent function can be added to the engine itself. What it doesn't do: - Convert the links / buttons - Put the query values as parameters of the $db->Execute - Uses the table header / table footer - Generates the menu.php or whatever other files - Convert the db structure Let me know if you find it any useful, but don't expect to simply copy / paste your code there and have your mod fully working for NWE.
-
In PHP I code mainly procedural, and I don't remember to have ever used a design pattern. However I use PHP only for my hobbies since a couple of years. At work I use C# / .NET and there I code exclusively in OO, with a lot of design pattern usages: singleton, object pool, factory, injection, observer, composite, command pattern are the one I use more frequently. However you may very well code without knowing them, and actually implement one of those pattern without actually knowing it. Why? Because some are so generic like the composite pattern that you may end up using it by chance. For your messy code, this is usually due to an initial design which didn't took in account all the needs, and / or is not flexible enough to change over time. However as the project grows / take ages, it's good practice to re-think it and restart from scratch. How often depends on your code, and project, some projects could be rewritten nearly on each major release, or 2 releases or some other projects can survive 10 years or more.
-
Has been released, stay tuned for the next iteration, my ideas are not over.
-
For the full version: - Removed ip security, http caching, security token from the index, they are all now inside their own modules. - Improved the profiler (gives more information about the hooks loaded). - Fixed bugs. - Added iterator to the DB access. - Added crafting module. - Added rich text editor. - Added table access for NPC combats. For the dev / free version: - Common index.php and common.php files with the full version - Added a pseudo security token. - Upgraded to latest versions of the existing modules - Improved the profiler - Upgraded the DB access file as the full version. For the full, you can either download the patch, or the full zip. For the dev version, as always only the full zip is available.
-
Too bad it's already defaced by some idiot which doesn't understand that open websites are not meant to be destroyed and doesn't make you smarter doing so. So, either you have a full time job keeping things clean or I suggest you to reduce the editing to only some trusted people.
-
- Crafting module has been implemented, you will be able to define what is required as raw material to create an item, and also define conditions when this crafting formula appears. - Implemented an iterator for the DB class, to make DB access yet even easier and code shorter. I will leave both ways such that old code still work, yet you could write it with the new way: Old code: <?php $result=$db->Execute("select id,name from objects"); while(!$result->EOF) { echo "{$result->fields[0]} {$result->fields[1]}<br>"; $result->MoveNext(); } New code: <?php foreach($db->Execute("select id,name from objects") as $row) echo "{$row[0]} {$row[1]}<br>"; Both codes do the exact same function, yet the new code is... quiet shorter and you can't miss the MoveNext call anymore. The trick is that basically the resultset class returned by the $db->Execute implements the PHP iterator interface, which let you then use the foreach keyword. BTW no it doesn't load the whole query result inside a large array and returns it. Why? because if the data returned is big, then it would simply eat up all the allowed memory, instead it retrieves row by row the data from MySQL.
-
Well how can you share the positions of the players? Think that each page load is a different process, sharing basically nothing. Variables are dropped and memory re-created every time. The trick of the sessions in PHP is basically to serialize an array in a file, and restore it on the next page load. To identify the right file a cookie is passed to the browser. Now either you do your own way to handle things across the different players, or you use what the tools offer you. I would strongly suggest to use memory tables if you can, they are both fast and works the same way as normal tables. Yet if you reboot the server the data inside the table is lot, but for a player position, I don't think it's such a huge issue.
-
Shared hosting are anyhow... ok just as start, so pick one, and survive with it. Good shared hosting (those which have a fast connection and good CPU) will kick you as soon as you use too much resources (even if it's written unlimited), the others simply end up being slow services. Cheap VPS are not much better, as you will end up with small amount of memory and an overall slow performance, without saying it cost you more than a shared hosting and yet you will have to handle more work yourself. So either you survive with a shared host (which means you have just a couple of players) or you will need to rend a dedi at some point (but that cost a lot more and require some knowledge from your side). http://www.top10bestwebsitehosting.com/ or search via google, you will find tons.
-
Don't use W3 Theory for hosting, I had simply way too many issues: - Took an hosting, pre-payed a year. - Uploading my script, and had very poor performances, with something like 2 sec to server a page load (script took 0.1 sec to execute). - Email address don't work, and had to contact them via this forums, took 2 weeks to get an answer... which didn't fixed the issue. - 2-3 weeks after the start of the hosting, their hosting went down due to a denial of service attack, and was down... for what, 2 weeks? - They sent an email saying they would reimburse us, after 3 weeks I didn't got anything, I asked via forum... Peter said he will do it quickly... and I'm still waiting, it has been nearly 2 months now. I basically lost money with them. So don't pick them up if you want a serious hosting.
-
Octet: There is no easy way to solve the problem the way you said it. Why? Because normally you can't share a variable across multiple PHP calls / sessions. To do so you would either need to use something called shared memory (which I don't think is usable on shared hosts), or have some sort of background process which would be then called from your PHP either via named pipe or local tcp connections. The easiest way is to store the map position on a MySQL memory table, which is basically like a table but data is never stored on the disk, and act nearly as quickly as an array. Again not all shared hosts offer memory tables (for a good reason) but if your hosting does have it, it's the easiest way to implement it.
-
Well the layout, and how things work shall not be hard to be modified. However thinking that a game is good if it is like any other one is really something sad, I mean, you would like to have all the console / PC games the sames? Me not. Same on the web, I would like to pick a game and know it is different from the thousand other out there. That's why an engine should be flexible enough to let you create whatever you want... or nearly.
-
Do a benchmark yourself to see which is faster. However, I doubt it will be such a huge difference and therefore use the appropriate way to do it, without yet really caring about the speed difference. That would be my choice.
-
Or use prepared statements like with MySQLi and you don't risk anything either.
-
Indeed blue, it would need a lot more work to make it really good. The jar, or tube, would need more details as said, and the bottom part of the body as been done in hurry compared to the head. Head about 2 hours, the remaining in about 1 hour
-
Switch would work even for numbers, however it would pick the value only for perfect fits, so let's say you have 10 different numbers and 10 values in the switch, that would work. Not in your case.
-
Thanks. Nice words are always welcome ;)
-
I must admit, I didn't saw many Dr. Who, and I must add, that the first time I saw it I thought what kind of lame thing it was. But if you take it less seriously it's actually nearly pleasant to watch. Anyhow, it inspired me this piece: [ATTACH=CONFIG]559[/ATTACH] The "monster" is modeled and textured inside ZBrush (took about 3 hours) The modeling of the scene compositions, lighting, rendering inside Modo 601, (about 3 hours again) So count about 6 hours for the whole work. And no it's not for a project, a game or anything else, it was just... the pleasure to make it and learn from it. On the critics side: The "feet" are horrible (and I simply didn't spent the time on those), as well as I should spend more time with the pose which is un-interesting, but hey, overall I'm happy with my results.
-
Sad isn't it? It didn't worked this time, but don't worry I'm sure you can get me next time ;)
-
Hahaha guest, I thought you didn't had time anymore for such salty answers ;) And no I will not answer, I let the others judge.
-
SilverStar: No I can't really answer you how much demands there is. It's like asking, how many download you will have if you create an Android app. A good one will have more downloads than a bad one. That's a first problem. Second, if you ask if the engine is widely used, then I can answer you that the engine has been released on March 2012, which means... just a couple of months ago, since then, the adoption of NWE is growing, but we still need to see a full working game with it. There are a couple of reasons why there isn't yet a game running NWE: - NWE doesn't have yet the content to really make it a full working game out of the box (and as you can see on the web pages, it is not advertised as ready to be played game). Why? because so far I concentrated on the quality of the base engine, features for the admin and the developers, more than simply delivering a game which could be run directly, and which would end up being the same for all, without the options to modify it. - It's a bit young, and people didn't got time yet to make their game with it. - The way NWE is handling things is quiet different from the concurrent engines. Not saying it's better or worse, let's stay with the word different ;) So if your question is, does it make sense to develop a module for NWE? I would answer yes, as at least you learn other ways to do things, and maybe some people will be interested in it too. Be assured there is already quiet a good number of licenses (full one) floating around, but I will not give you the numbers here. If your question is, will I make tons of money by creating NWE mods, then my quick answer is: no, you will not. Or at least I doubt. There is no quick money, and NWE is certainly not a quick money making. But I doubt you do tons of money quickly with McCode or ezrpg or whatever else mods. At least it depends of the "tons" definition ;)
-
Thanks coder, if you didn't try the free version, and see how you can develop with it. There is even a tutorial on the help pages how to write your first module.
-
I don't think there is a completely right way, and a completely wrong way as long as it work. Programming is also matter of taste. So some prefer concatenations, other use the string parsing or use formatting functions. Is one or the other way wrong? No as all 3 will make the same result. Sure if you are after extremely high speed, then maybe you would look into optimizing your code, but then, the best option is to leave PHP to something faster like Java, .NET or even plain C / C++ code.