Saturday, September 27, 2014

AndEngine - Level Editor


Good news for all of the andengine developers. :) basic level editor is here.

For my game i had to find the very basic level editor, but all of the threads on andengine forum were either closed or have buggy level editors.
So i decided to make my own level editor and share it to community. Though andengine has very less documentation but matim-dev provided great tutorials to make the developers life easy. Thanks to him.
Since its very basic and i am following his level xml example so you can have the format like that. where type will automatically be picked from the image file name. let me show you how.

<level width="1000" height="780">    
    <entity x="100" y="100" type="platform1"/>
    <entity x="200" y="200" type="platform1"/>
    <entity x="400" y="200" type="platform3"/>
    <entity x="550" y="300" type="platform2"/>
    <entity x="720" y="240" type="platform3"/>
    <entity x="400" y="270" type="coin"/>
    <entity x="500" y="400" type="coin"/>
    <entity x="600" y="400" type="coin"/>
</level>
  

 First of all we need to load the resources that we are gonna use within our level. For this go to Sprites menu and press load sprites.In above example, plateform1,plateform2,plateform3,coin are sprites. Once its done you will be able to see those sprite in left column.

On right column you can set the height and width of the level.

Now you can either load the existing level by going to file menu and press load level or you can create your own level just by grabbing the entities from the left panel to canvas.
Place the items where you want and save it from file menu and you are done :)






Umar Hadyatullah
Senior Software Engineer


Bookmark and Share

Thursday, February 16, 2012

Bootable USB OSX Lion (Hacintosh)

Create Bootable USB pen with OSX Lion
--------------------------------------------------------------
a. With Disk Utility erase USB pen
GUID + HFS+ journaled
rename it "OSX Lion Boot"
b. With Disk Utility restore Lion.dmg to USB Pen

c. Install Extra_Lion.pkg to USB Pen
Install PC-EFI 10.6.pkg to USB Pen -> here http://www.mediafire.com/?vec09o8nifdgq7n
Install Chameleon 2.0 RC5 -755.pkg to USB Pen

reboot with first boot usb option

Reference:
http://osx86.co/archive/index.php/t-7279.html

Umar 
Bookmark and Share

Friday, January 27, 2012

Bootable ISO from bootable USB

Here is a complete guide how to make a boot able  iso from boot able usb.(boot able windows 7/vista iso from boot able usb)

Special thanks to Mr. Adrian


1 Install ImgBurn is free, you can find on google
2 Plug the bootable stick into the computer
3 Start ImgBurn
4 Now click on the "Create image file from files / folders"
5 Now in the "Sources" browse to your USB stick
6 in the "Destination" choose where to save the final ISO image
7 Now go right in the "Advanced" tab and then "Bootable Disk"
8 Check the box "Make Bootable Image" and then, in the "Boot image" box browse to file "etfsboot.com" that is in your bootable stick found in the folder "boot"
9 In the field "Developer ID" put "Microsoft Corporation" and enter "07C0" in the "Load Segment" field
10 Enter '4' in the 'Sectors To Load' field if your etfsboot.com file is 2K is size, enter '8' if it's 4K. (Basically it's the size of the file in bytes divided by 512 - i.e. 2048 / 512 = 4)

Note: Vista's is normally 2KB and Windows 7's is 4KB... so enter '4' if you're building a Vista OS installation disc and '8' if you're building a Windows 7 OS installation disc.

And now everything is ready we click on "Build". So this is everything you expect if you have questions post! 


Umar 
Bookmark and Share

Saturday, July 30, 2011

Mongodb Sharding Configurations on Windows

When i started using mongodb for the first time.... my all relational database concepts went crazy :p :p :p In RDBMS we had to normalize the data in order to avoid the redundancy etc.... but mongodb says that why you keep the data separately if then you had to pick the data by joining the table. Therefore there are no joins in the mongo and you have to put the pre joined data in the collections (tables in RDBMS)

But this forum is again for the sharding configuration so i am not gonna put the other details in it.... which are actually very basic and you can also find them from the mongodb official site.

Sharding is basically a concept of distributing the data with respect to their accordance... like the goolge shows the different results for the same keyword if we search them on different google domains... (google.com,google.com.pk,google.fr) Similarly we tell the database that how the data is being sharded either w.r.t country wise /region wise etc.
So ok download the latest copy from the official mongodb site and extract it to the safe location
First we create a simple mongodb database you need to follow the following commands.
Open the command prompt as administrator..... press window button...write cmd and right click the cmd and open it as administrator.
Lets see i have extracted the mongofile to c drive and suppose it is in c:\mongodb\bin
Make a folder where you want to put the database let say d:\mongo\db1
you need to reach the path to extracted directory (c:\mongodb\bin) and wtite
mongod --dbpath="d:\mongo\db1" --logpath="d:\mongo\db1\log.txt"
database shard will be created and you can communicate with it by starting the mongodb client (talk about it later) and you can also create the multiple shards with this command either on the same machine with different ports or on other machines too.
Now we need to add a configuration db. This will keep the record that how many shards will be in the database.
So make a folder where you want to place config e.g (d:\mongo\config)
mongod --dbpath="d:\mongo\config" --port (port can be explicitly specify with each mongo process)
Now we have to configure a mongos which will be responsible for routing the request to the particular shard
mongos –port 10003 –configdb localhost:10002
e.g 10003 is the port on which the routing service process will run and we will assign it the address of the running config db (e.g in my case it is running on localhost:10002)
So at the end we have to start the mongodb client to see the database and collections etc
run the following command
mongo localhost:10003
now you are connected to the shell and now you need to tell the shell that db1 (that we created in first step) will be the shard of the database to do this
use admin
db.runCommand( { addshard : “localhost:10000″, name : “shard10000″ } );
To shard a database you can run the following command:
db.runCommand( { enablesharding : “” }
In this scenario you will be splitting the collections based on the key pattern that you’ve specified.  I’ll explain how this works in a location based scenario a bit later on.  For now, you need to know that while MongoDB allows you to specify keys to split the underlying collection in the database, it does not allow you to specify which shard to write to.  So, if you set this up MongoDB will decide where to place the data.  There is a way to force this to happen here, but that doesn’t mean that MongoDB will keep that configuration.

So here we go...its all done now.... and similarly we can create more shard and can add them to the same config db and mongodb automatically distributes the data in form of chunks (64mb max) and place them together with respect to the shard key.....
cheers

 
Umar 
Senior Software Engineer
Lahore, Pakistan
Bookmark and Share

Friday, June 18, 2010

Nettiers MYSQL Template.

After a long time i am back in my blog. You will be happy to know that i came with the solution of nettiers integration template with mysql. Please follow the following guide lines to use it.


Prerequisite:

  1. Please go to the sun website download and install the latest connector of mysql. ( i guess currently it is 6.2 ).
  2. If you want to check it locally then install the mysql server 5.1 or later and you can use sql yog 8.3 for mysql management studio.
  3. This template only works with latest versions of codesmith i.e 5.2 or later as it has a complete provider of mysql.
Creating a new database in mysql.
  1. While creating a new database please make sure that you have set its engine to innodb to make the database relational.
  2. Create the database , tables ,index and relations between the table.
  3. Currently all the native types used in MS-SQL are working in mysql template. other types can produce the error.
  4. Once you create the database you are ready to generate its classes now.
Download:
Click Here to download its beta version.

Note: You are all welcome to report its bugs and errors because this is not a fully tested version. I appreciate the community help and guidance in creating this template specially Blake Niemyjski.


for discussions and help please follow the official forum link below.
http://code.google.com/p/nettiers/issues/detail?id=19


If you are using ms-sql nettiers template, please update the template to latest version and apply the patch which i have provided on above link.


Umar .




Bookmark and Share

Tuesday, January 26, 2010

Nettiers Command Timeout problem

I have been facing this problem usually when the database size increases and couple a parallel calls to sqlserver are sent for query then this problem can occur. I dig out the problem by googling it but did not find any solution without changing its source code i.e use the commandtimeout  in command wrapper as described in the following link.
http://nettiers.com/FrequentlyAskedQuestions.ashx#I_set_the_codeNetTiersProviderDefaultCommandTimeoutcode_property_so_why_does_my_slow_Sproc_time_out_using_the_SQL_provider_8

We can change the template at all.After completing a huge application. After looking into this problem a lot. i reached at the solution.Nettiers structure use the defaultcommandtimeout property in the provider class which is exactly 30 by default retrieved from the template we people used usually. OK there is no problem at all.Only one thing that we have to use to set this property.i.e just to add the defaultcommandtimeout property to providers settings.

Just replace the below providers settings of the configuration file

   
     
           type="Northwind.Data.SqlClient.SqlNetTiersProvider, Northwind.Data.SqlClient"
           connectionStringName="netTiersConnectionString"
           providerInvariantName="System.Data.SqlClient"
           entityFactoryType="Northwind.Entities.EntityFactory"
           useEntityFactory="true"
           enableEntityTracking="false"
           enableMethodAuthorization="false"
           useStoredProcedure="false" />
   

 

with

   
     
           type="Northwind.Data.SqlClient.SqlNetTiersProvider, Northwind.Data.SqlClient"
           connectionStringName="netTiersConnectionString"
           providerInvariantName="System.Data.SqlClient"
           entityFactoryType="Northwind.Entities.EntityFactory"
           useEntityFactory="true"
           enableEntityTracking="false"
           enableMethodAuthorization="false"
           defaultCommandTimeout="180"
           useStoredProcedure="false" />
   

 

Change the defaultCommandTimeout according to your need


Umar 






Bookmark and Share

Friday, March 6, 2009

Solution of Intel 8291X series VGA problem with Windows 7

Intel 8291X chipset Series VGA driver problem with Windows 7 Issue

After launching the windows 7 beta I installed it on the PC having Intel 82915G/GL/GV chipset series mother board. By default it has shared VGA memory up to 128MB in XP. Windows 7 automatic updates find its driver from the internet and after installing this driver it just hanged.

When I consult the forums of Intel website then I came to know that Intel 82910/82915 series VGA is based on the XPDM model which is not supported by aero feature of windows vista and windows 7, As Windows vista supports the WDDM architecture model to provide all the features.

There is one solution I found it after installing the driver. After rebooting the PC just press f8 to go into directory services repair mode. System will boot in repair mode. Just right click on desktop go to the resolution and select advance, it will open graphic properties dialog. Go to the troubleshoot Tab and set hardware acceleration to none. And restart your PC. It will never hang now. Remember if u increase your hardware acceleration it will help you to play the games but when you play any video file it will hang again. So set hardware acceleration to none before playing any video.


--- Issue now resolved in RC pack


Umar Kashmiri
ASE CTO 24/7 Pvt. Ltd.