Showing posts with label gamemaker. Show all posts
Showing posts with label gamemaker. Show all posts

Friday, September 24, 2021

GameMaker Studio 2 Linux IDE (Ubuntu)

 



Wow. Gamemaker Studio 2 has an Ubuntu IDE and i have missed the party.

Yoyogames states that the Ubuntu IDE is at beta state and not suitable for production machine

Using the Ubuntu IDE beta

Note that this IDE is not suitable for a production environment at this time. Please continue to use a Windows/Mac as your main development machine and give feedback on the Ubuntu IDE if you wish to try it.

This early beta IDE is specifically for Ubuntu 20.04 LTS versions and no other distro is offered any support - it may work if you can install the .deb, but we will not answer tickets about other distros or customised kernels, etc., as we are only interested in Ubuntu feedback.
You must have Mono 6 installed first (it does come with Ubuntu 20.04 LTS, so you should have it already). Beyond that, GMS2 will try to install any required components during the installer process, so ensure you are connected to the internet first.
A separate physical Windows PC is still required for targeting Windows, UWP, and any consoles - see the target's own section below for specifics.
A separate physical Mac is still required for targeting macOS, iOS/iPadOS, and tvOS - see the target's own section below for specifics.
When targeting the other machine, we would highly recommend both machines are connected to your network using Ethernet, rather than WiFi, as this can result in issues when building large projects for YYC.

GMS2 2.3.0 or above: supports Ubuntu 20.04 LTS 64bit and Ubuntu 18.04 LTS 64bit.
In GMS2 2.3.1+, you also have the option of building ARMv7 packages by simply targeting an ARMv7 device when you do your build.
Ubuntu 18.04 LTS 64bit is the last version supported by 2.2.5 or older, so please update your GMS2.
For simply playing GMS2 games: Ubuntu 16 or later is required. Other distros can usually run the games GMS2 generates with no issues, but we only state support for Ubuntu, so if you have issues playing games on these other platforms you will need to investigate this yourself. All games are 64bit-only.

ARMv7 architecture support is available for games built with GMS2 2.3.1 or newer if the developer built the package using an ARMv7 device.

Another useful links :
1. GMS 2 Required SDKs

2. Setting Up For Ubuntu.
Yoyogames do not recommend trying newer versions of Ubuntu than they claim support for.

You will need to install the development libraries/tools required during builds.

sudo apt-get install <packagename>

where you replace <packagename> with each of the following individually and keep running apt until you have installed all of them:

build-essential
openssh-server
clang
libssl-dev
libxrandr-dev
libxxf86vm-dev
libopenal-dev
libgl1-mesa-dev
libglu1-mesa-dev
zlib1g-dev
libcurl4-openssl-dev

Please note that GMS2 2.2.3 and above also require the "nproc" package to be installed. This is installed by default in Ubuntu 18, but might not be there if you have customised your install (or may not be installed by default in other distros), so be aware you might need to install this manually also.

Similarly, if you had selected "3rd Party Components" when prompted during installing Ubuntu itself, you may already have the OpenAL libraries installed.

3. Ubuntu: Compiling Your App

The highlight from the link above is:
It is important to note that - depending on the version of Ubuntu that the user has - additional dependencies may need to be installed to permit them to play the game and this should be mentioned when distributing your compiled projects. The dependencies are:

libcurl4
libopenal1

Users should install these packages on their machine otherwise the games won't run. Note that it is possible to create *.sh scripts to automate this process and include that with your final package.

4. Forum Yoyogames: Official Anouncement

the direct link download (date: Sept 13, 2021):
 
edit:
New version avaliable.

Lets install Gamemaker Studio 2!

Download the .deb file and install it. 
$ sudo dpkg -i <filename>.deb














The dpkg will complain about some unmet dependencies. We can fix it with apt.
$ sudo apt-get --fix-broken install

473 MB needs to be downloaded >.<"


















Now lets run Gamemaker Studio 2. Search and click the icon.










The Gamemaker Studio 2 running for the first time















The IDE will try to download and installing runtime. It will take a while








...and here it is. Happy Gamemaking!















p.s. dont forget to install the rest of package requirement.
It need to download another 659MB >.<"















Friday, January 24, 2020

GameMaker Studio 2 - Build-In Functions

4. BUILD-IN FUNCTIONS

Last post we have learn how to draw a rectangle using draw_rectangle () function. This function is a build-in functions that available within the GameMaker Studio 2 Language (GML). For all the list of available functions along with the required arguments and examples of code to show how thy can be used, we can look it at the documentations from yoyogames here.

Aside from the web documentations, middle click at the function within the editor will open a documentation tab to find some brief explanations and examples.








Now lets "move-along" with the lesson from sheepolution.com. 😀

Just like the post before, we start by drawing another rectangle in the draw event :

//Draw a rectangle
draw_rectangle(100,50,200,150,true);


When we look at the documentations, the numbers are x and y position of the left corner rectangle against the GameMaker room, as of (0,0) is located at the top left of the screen or at the top left of the GameMaker room.










draw_rectangle(100,50,200,150,true);

100 = The x coordinate of the top left corner of the rectangle.
50   = The y coordinate of the top left corner of the rectangle.
200 = The x coordinate of the bottom right corner of the rectangle.
150 = The y coordinate of the bottom right corner of the rectangle.
true = Whether the rectangle is drawn filled (false) or as a one pixel wide outline (true).




















And now, how to make the rectangle move? 
When the rectangle move, means the coordinates is being altered either by adding some amount of value or by subtract some amount of value.

In LÖVE framework (as written at sheepolution.com tutorials), we do this by using code :

function love.load() x = 100 end
function love.update() x = x + 5 end
function love.draw() love.graphics.rectangle("line", x, 50, 200, 150) end


Lets add a Create event :
x = 100;

And add a Step event :
x = x + 1;













And modified the draw event :
draw_rectangle(x,50,200,150,true);


and things become very weird :
Why is that?

Lets take a look at the function that we write in the draw event :

draw_rectangle(x1,y1,x2,y2,true);
draw_rectangle(x,50,200,150,true);

We only alter the value of x1 but not x2, thats why. The x1 is moving along 1 pixel at a time at x axis, but the x2 is not moving because the value is fix at (200,150) coordinates.

Now lets fix the code :

draw_rectangle(x,50,x+100,150,true);

why is x+100, not x+200 ?
Well, we have create a variable in the Create event :

x = 100

so x+100 equal to 100+100 = 200.

If we run the game now, the rectangle now should move normally.

GameMaker Studio 2 - LÖVE

3. LÖVE

LÖVE is a framework, a tool that makes programming games easier.
.....wait, what ? 😁

I was browsing through some game engines that run on linux and i found this sheepolution.com, a beautiful web contain tutorials for LÖVE game engine. Its written there, that LÖVE calls 3 functions :




- love.load()
- love.update()
- love.draw()

To draw a rectangle using LÖVE, we do the following :

function love.draw() love.graphics.rectangle("fill", 100, 200, 50, 80) end

What about GMS2 ?
Lets create a GameMaker Language Project, double click on the room0 and set it to 640 width and 480 height in room properties.











Lets create an object by pressing Alt + O.  An Object Window will appear alongside with event window.

There are lots of event listed there, but as far as i know, following LÖVE main functions, the three main event is create event, step event, and draw event.

To draw a rectangle using GMS 2, we do the following :

Add a draw --> draw event. Another window will pop up where we can write our code.
We add functions :

//Draw a rectangle
draw_rectangle(100,200,50,80,false);

Now, go to room tab, and drag the object from the right panel into room0.











Run the game by pressing F5, and voila, there's the rectangle 😊

Friday, October 13, 2017

GMS2 view_xview, view_yview

GameMaker Studio 2 has a list of obsolete function, including View Variables And Windows Functions.

From https://docs2.yoyogames.com/ , GMS2 introducing a camera function.

With the advent of the camera functions in GameMaker Studio 2, it means that a number of view variables are no longer required, specifically those referring to the view into the room rather than the view_port (which is still used). There are also a few functions for controlling how things are displayed that were available in legacy versions of GameMaker: Studio 1.4 which are also no longer appropriate. These variables and functions are listed below:

view_object     view_angle     view_xview     view_yview
view_hview     view_wview     view_hborder     view_vborder
view_hspeed     view_vspeed    
display_set_windows_vertex_buffer_method    
display_get_windows_vertex_buffer_method
display_set_windows_alternate_sync    
display_get_windows_alternate_sync    
room_set_view     


GMS1 center the view:
view_xview[0] = x - view_wview[0]/2;
view_yview[0] = y - view_hview[0]/2;

Alternative script for GMS2:
var view_xview = x - camera_get_view_width(view_camera[0]);
var view_yview = y - camera_get_view_height(view_camera[0]);
camera_set_view_pos(view_camera[0], view_xview/2, view_yview/2);

or obviously you can write it like this:
var view_wview = camera_get_view_width(view_camera[0]);
var view_hview = camera_get_view_height(view_camera[0]);

var view_xview_c = x - view_wview/2;
var view_yview_c = y - view_hview/2;
camera_set_view_pos(view_camera[0], view_xview_c, view_yview_c);

So we got a substitute for the code! We can continue to follow the GMS1 tutorial from youtube.
Well, not the greatest solution, but it works.
screenshake?
 
^_^




Monday, October 9, 2017

New Splash Screen GMS 2

Hey! A new update. Its Version 2.1.1.241 Download. Wed, 04 Oct 2017 08:37:57 Z. And it has a new randomize splash screen.

We can read the Release Notes here,
but here is the hightlight first four :



  • Added some cool new splash screens and now randomly choose which is shown.
  • Language files now have the standard 2-digit language code in them, and GMS2 will now auto-select its language for new installs by using your OS language.
  • Mac installer will now remove all previous files, cleaning out the installed folder.
  • New sprite editor filters added to help get rid of halos and glows around sprites.
The old splash screen.
... and the three randomize addition.



What do you think? :p





Thursday, September 28, 2017

Game Maker Studio 2 - Runtimes

Runtimes? What is runtimes?
Lets find up in the official documentation:

GameMaker Studio 2 is more than just an IDE and has a number of different runtime tools that it uses behind the scenes to build you games for the different target platforms available. These tools are mainly the different runners and compilers that each platform requires, and you can actually have several of each at any one time. What this means is that you can "pick and choose" which compiler version and which runner version to use should you have found any issues with the current one or are aiming at a very specific target version or platform. Tools will automatically update when there is a new version available, but you can then use the Runtime Feeds Preferences to select which ones you actually want to use.

Every now and then GMS2 will notify if there is a new version is available for download. We also can check it manually from preferences.
You can update the runtime list at any time by clicking the refresh button .

The current Runtime

Available Runtime version

How to select a different runtime to use, simply find it in the list and then double click on it. If the runtime has not been downloaded and installed, then you will be prompted to do so, and once it has been installed you will be prompted to close and restart the IDE so that the new runtime can be initialised.

 
And we're good to go.